-# Written in 2022 by Amélia COUTARD <eliottulio.coutard@gmail.com>
-# To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this file to the public domain worldwide. This file is distributed without any warranty.
-# You should have received a copy of the CC0 Public Domain Dedication along with this file. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
+# Written in 2023 by Amélia COUTARD <eliottulio.coutard@gmail.com>
+# To the extent possible under law, the author(s) have dedicated all copyright
+# and related and neighboring rights to this file to the public domain worldwide.
+# This file is distributed without any warranty.
+# You should have received a copy of the CC0 Public Domain Dedication along with
+# this file. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
# So, about the license. I don't think I have a copyright on this file's code, but,
# since I gave it the CC0 license in case I do, that doesn't matter either way.
+# Written in 2023 by Amélia COUTARD <eliottulio.coutard@gmail.com>
+# To the extent possible under law, the author(s) have dedicated all copyright
+# and related and neighboring rights to this file to the public domain worldwide.
+# This file is distributed without any warranty.
+# You should have received a copy of the CC0 Public Domain Dedication along with
+# this file. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+# So, about the license. I don't think I have a copyright on this file's code, but,
+# since I gave it the CC0 license in case I do, that doesn't matter either way.
+
menuentry "Amycros" {
multiboot2 /boot/kernel.elf64
module2 /boot/test-module.elf64 test-module
+/* Written in 2023 by Amélia COUTARD <eliottulio.coutard@gmail.com>
+ * To the extent possible under law, the author(s) have dedicated all copyright
+ * and related and neighboring rights to this file to the public domain worldwide.
+ * This file is distributed without any warranty.
+ * You should have received a copy of the CC0 Public Domain Dedication along with
+ * this file. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+ * So, about the license. I don't think I have a copyright on this file's code, but,
+ * since I gave it the CC0 license in case I do, that doesn't matter either way.
+ */
+
ENTRY(_start)
KERNEL_VMA = 0xFFFFFFFF80000000;
-# Written in 2022 by Amélia COUTARD <eliottulio.coutard@gmail.com>
-# To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this file to the public domain worldwide. This file is distributed without any warranty.
-# You should have received a copy of the CC0 Public Domain Dedication along with this file. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
+# Written in 2023 by Amélia COUTARD <eliottulio.coutard@gmail.com>
+# To the extent possible under law, the author(s) have dedicated all copyright
+# and related and neighboring rights to this file to the public domain worldwide.
+# This file is distributed without any warranty.
+# You should have received a copy of the CC0 Public Domain Dedication along with
+# this file. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
# So, about the license. I don't think I have a copyright on this file's code, but,
# since I gave it the CC0 license in case I do, that doesn't matter either way.
+// Copyright 2023 Amélia COUTARD.
+//
+// This file from the program isos is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free Software Foundation,
+// either version 3 of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with this program. If
+// not, see <https://www.gnu.org/licenses/>.
+
#include "lib/multiboot2.hpp"
.set KERNEL_VMA, 0xFFFFFFFF80000000
+// Copyright 2023 Amélia COUTARD.
+//
+// This file from the program isos is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free Software Foundation,
+// either version 3 of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with this program. If
+// not, see <https://www.gnu.org/licenses/>.
+
#include "elf64.hpp"
+// Copyright 2023 Amélia COUTARD.
+//
+// This file from the program isos is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free Software Foundation,
+// either version 3 of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with this program. If
+// not, see <https://www.gnu.org/licenses/>.
+
#pragma once
#include <cstdint>
+// Copyright 2023 Amélia COUTARD.
+//
+// This file from the program isos is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free Software Foundation,
+// either version 3 of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with this program. If
+// not, see <https://www.gnu.org/licenses/>.
+
#define PUSH_REGS \
pushq %rax; \
pushq %rcx; \
+// Copyright 2023 Amélia COUTARD.
+//
+// This file from the program isos is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free Software Foundation,
+// either version 3 of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with this program. If
+// not, see <https://www.gnu.org/licenses/>.
+
#include "interrupts.hpp"
#include "utils.hpp"
#include <cpuid.h>
+// Copyright 2023 Amélia COUTARD.
+//
+// This file from the program isos is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free Software Foundation,
+// either version 3 of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with this program. If
+// not, see <https://www.gnu.org/licenses/>.
+
#pragma once
#include <cstdint>
+// Copyright 2023 Amélia COUTARD.
+//
+// This file from the program isos is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free Software Foundation,
+// either version 3 of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with this program. If
+// not, see <https://www.gnu.org/licenses/>.
+
#include "lib/multiboot2.hpp"
#include "paging.hpp"
#include "utils.hpp"
+// Copyright 2023 Amélia COUTARD.
+//
+// This file from the program isos is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free Software Foundation,
+// either version 3 of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with this program. If
+// not, see <https://www.gnu.org/licenses/>.
+
.section .init
.global _init
.type _init, @function
+// Copyright 2023 Amélia COUTARD.
+//
+// This file from the program isos is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free Software Foundation,
+// either version 3 of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with this program. If
+// not, see <https://www.gnu.org/licenses/>.
+
.section .init
/* gcc will nicely put the contents of crtend.o's .init section here. */
popq %rbp
+// Copyright 2023 Amélia COUTARD.
+//
+// This file from the program isos is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free Software Foundation,
+// either version 3 of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with this program. If
+// not, see <https://www.gnu.org/licenses/>.
+
#pragma once
#ifdef __cplusplus
+// Copyright 2023 Amélia COUTARD.
+//
+// This file from the program isos is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free Software Foundation,
+// either version 3 of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with this program. If
+// not, see <https://www.gnu.org/licenses/>.
+
#pragma once
#include <cstddef>
+// Copyright 2023 Amélia COUTARD.
+//
+// This file from the program isos is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free Software Foundation,
+// either version 3 of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with this program. If
+// not, see <https://www.gnu.org/licenses/>.
+
#include "paging.hpp"
#include "serial.hpp"
+// Copyright 2023 Amélia COUTARD.
+//
+// This file from the program isos is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free Software Foundation,
+// either version 3 of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with this program. If
+// not, see <https://www.gnu.org/licenses/>.
+
#pragma once
#include <cstdint>
+// Copyright 2023 Amélia COUTARD.
+//
+// This file from the program isos is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free Software Foundation,
+// either version 3 of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with this program. If
+// not, see <https://www.gnu.org/licenses/>.
+
.section .text
.globl ftl_to_userspace
+// Copyright 2023 Amélia COUTARD.
+//
+// This file from the program isos is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free Software Foundation,
+// either version 3 of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with this program. If
+// not, see <https://www.gnu.org/licenses/>.
+
#include "ring3.hpp"
#include "utils.hpp"
#include "serial.hpp"
+// Copyright 2023 Amélia COUTARD.
+//
+// This file from the program isos is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free Software Foundation,
+// either version 3 of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with this program. If
+// not, see <https://www.gnu.org/licenses/>.
+
#pragma once
#include <cstdint>
+// Copyright 2023 Amélia COUTARD.
+//
+// This file from the program isos is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free Software Foundation,
+// either version 3 of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with this program. If
+// not, see <https://www.gnu.org/licenses/>.
+
#include <cstddef>
#include "serial.hpp"
#include "utils.hpp"
+// Copyright 2023 Amélia COUTARD.
+//
+// This file from the program isos is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free Software Foundation,
+// either version 3 of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with this program. If
+// not, see <https://www.gnu.org/licenses/>.
+
#pragma once
#include <cstdint>
+// Copyright 2023 Amélia COUTARD.
+//
+// This file from the program isos is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free Software Foundation,
+// either version 3 of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with this program. If
+// not, see <https://www.gnu.org/licenses/>.
+
#include "utils.hpp"
#include "interrupts.hpp"
#include <cpuid.h>
+// Copyright 2023 Amélia COUTARD.
+//
+// This file from the program isos is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free Software Foundation,
+// either version 3 of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with this program. If
+// not, see <https://www.gnu.org/licenses/>.
+
#pragma once
#include <cstdint>
-# Written in 2022 by Amélia COUTARD <eliottulio.coutard@gmail.com>
-# To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this file to the public domain worldwide. This file is distributed without any warranty.
-# You should have received a copy of the CC0 Public Domain Dedication along with this file. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
+# Written in 2023 by Amélia COUTARD <eliottulio.coutard@gmail.com>
+# To the extent possible under law, the author(s) have dedicated all copyright
+# and related and neighboring rights to this file to the public domain worldwide.
+# This file is distributed without any warranty.
+# You should have received a copy of the CC0 Public Domain Dedication along with
+# this file. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
# So, about the license. I don't think I have a copyright on this file's code, but,
# since I gave it the CC0 license in case I do, that doesn't matter either way.
+// Copyright 2023 Amélia COUTARD.
+//
+// This file from the program isos is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free Software Foundation,
+// either version 3 of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with this program. If
+// not, see <https://www.gnu.org/licenses/>.
+
.section .text
.globl print
+// Copyright 2023 Amélia COUTARD.
+//
+// This file from the program isos is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free Software Foundation,
+// either version 3 of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with this program. If
+// not, see <https://www.gnu.org/licenses/>.
+
#include <stddef.h>
extern "C" void print(char c);