We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 298ba88 commit 261660bCopy full SHA for 261660b
src/second_stage.s
@@ -10,6 +10,18 @@ second_stage:
10
lea si, second_stage_start_str
11
call println
12
13
+set_target_operating_mode:
14
+ # Some BIOSs assume the processor will only operate in Legacy Mode. We change the Target
15
+ # Operating Mode to "Long Mode Target Only", so the firmware expects each CPU to enter Long Mode
16
+ # once and then stay in it. This allows the firmware to enable mode-specifc optimizations.
17
+ # We save the flags, because CF is set if the callback is not supported (in which case, this is
18
+ # a NOP)
19
+ pushf
20
+ mov ax, 0xec00
21
+ mov bl, 0x2
22
+ int 0x15
23
+ popf
24
+
25
load_kernel_from_disk:
26
# start of memory buffer
27
lea eax, _kernel_buffer
0 commit comments