File tree Expand file tree Collapse file tree 4 files changed +28
-1
lines changed Expand file tree Collapse file tree 4 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 44
55extern kernel_core_entry
66extern reload_idt_table
7+ global kernel_core_entry_asm
78
89[SECTION .text]
9- ; protected mode real entry point.
10+ ; protected mode real entry point.
1011 CLI
1112 mov ax , 0x10
1213 mov es , ax
@@ -26,3 +27,9 @@ extern reload_idt_table
2627 STI
2728 pop eax
2829 jmp eax
30+
31+ ; kernel_core_entry_asm currently exists only for tests.
32+ kernel_core_entry_asm:
33+ ; __TEST_INJECT_KERNEL_CORE_ENTRY__: mov eax, 0x922E52FF
34+ ; __TEST_INJECT_KERNEL_CORE_ENTRY__: HLT
35+ ret
Original file line number Diff line number Diff line change 1313#include "kernel/process.c"
1414
1515extern void kernel_enable_interrupts ();
16+ extern void kernel_core_entry_asm ();
1617
1718char command [30 ];
1819int send_int (int a ,int b ) {
@@ -26,6 +27,9 @@ void kernel_core_entry() {
2627 print_log ("Initializing Kernel" );
2728
2829 populate_and_load_idt_table ();
30+
31+ kernel_core_entry_asm ();
32+
2933 print_log ("Kernel enabling interrupts" );
3034 kernel_enable_interrupts ();
3135 keyboard_init ();
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ TEST_INJECT_WORD=" __TEST_INJECT_KERNEL_CORE_ENTRY__"
4+ TEST_MAGIC_WANT=" 922E52FF"
5+
6+ source tests/lib.sh
7+
8+ os_test_up " ${TEST_INJECT_WORD:? } " || exit -1
9+
10+ # Test
11+ set -e
12+ echo " ${SCREEN_CONTENT:? } " | grep " Initializing Kernel" || ( echo " Test Failed!" && exit -1 )
13+ echo " ${SCREEN_CONTENT:? } " | grep " Loading IDT Table" || ( echo " Test Failed!" && exit -1 )
14+ wait ${QEMU_PID:? }
15+ echo " $0 passed!!!"
Original file line number Diff line number Diff line change 44# Execute Tests
55bash tests/bootloader_stage1_test.sh
66bash tests/bootloader_stage2_test.sh
7+ bash tests/kernel_core_entry_test.sh
78
89# Done
910echo " All tests passed!"
You can’t perform that action at this time.
0 commit comments