aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mubios/arch/mode_switch.S4
-rw-r--r--mubios/core/post.c26
-rw-r--r--mubios/include/bios.h27
-rw-r--r--mubios/linker.ld1
4 files changed, 58 insertions, 0 deletions
diff --git a/mubios/arch/mode_switch.S b/mubios/arch/mode_switch.S
index 17fbe72..f114870 100644
--- a/mubios/arch/mode_switch.S
+++ b/mubios/arch/mode_switch.S
@@ -22,6 +22,8 @@
.section .text16, "ax"
+ .extern post_main
+
.global enter_protected_mode
.type enter_protected_mode, @function
@@ -101,6 +103,8 @@ protected_mode_entry:
mov esp, 0x00008000
+ call post_main
+
protected_mode_halt:
hlt
jmp protected_mode_halt
diff --git a/mubios/core/post.c b/mubios/core/post.c
new file mode 100644
index 0000000..d8ae85c
--- /dev/null
+++ b/mubios/core/post.c
@@ -0,0 +1,26 @@
+/*
+ RCC-Project
+
+ Copyright (C) 2026 Richard Qin
+
+ This file is part of RCC-Project.
+
+ RCC-Project 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.
+
+ RCC-Project 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
+ RCC-Project; see the file COPYING. If not see
+ <http://www.gnu.org/licenses/>.
+ */
+
+#include "bios.h"
+
+void post_main(void)
+{
+}
diff --git a/mubios/include/bios.h b/mubios/include/bios.h
new file mode 100644
index 0000000..1f51244
--- /dev/null
+++ b/mubios/include/bios.h
@@ -0,0 +1,27 @@
+/*
+ RCC-Project
+
+ Copyright (C) 2026 Richard Qin
+
+ This file is part of RCC-Project.
+
+ RCC-Project 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.
+
+ RCC-Project 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
+ RCC-Project; see the file COPYING. If not see
+ <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef MUBIOS_BIOS_H
+#define MUBIOS_BIOS_H
+
+void post_main(void);
+
+#endif // MUBIOS_BIOS_H
diff --git a/mubios/linker.ld b/mubios/linker.ld
index 003c29b..85545d3 100644
--- a/mubios/linker.ld
+++ b/mubios/linker.ld
@@ -44,6 +44,7 @@ SECTIONS
.text32 :
{
*(.text32 .text32.*)
+ *(.text .text.*)
} > ROM
. = ALIGN(4);