Skip to content

Commit f6c3d68

Browse files
committed
Remove unreal mode code from boot.s
We can do this later in the second stage.
1 parent a333010 commit f6c3d68

File tree

1 file changed

+0
-60
lines changed
  • real_mode/first_stage/src

1 file changed

+0
-60
lines changed

real_mode/first_stage/src/boot.s

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -30,40 +30,6 @@ enable_a20:
3030
out 0x92, al
3131
enable_a20_after:
3232

33-
enter_protected_mode:
34-
# clear interrupts
35-
cli
36-
push ds
37-
push es
38-
39-
lgdt [gdt32info]
40-
41-
mov eax, cr0
42-
or al, 1 # set protected mode bit
43-
mov cr0, eax
44-
45-
jmp protected_mode # tell 386/486 to not crash
46-
47-
protected_mode:
48-
mov bx, 0x10
49-
mov ds, bx # set data segment
50-
mov es, bx # set extra segment
51-
52-
and al, 0xfe # clear protected mode bit
53-
mov cr0, eax
54-
55-
unreal_mode:
56-
pop es # get back old extra segment
57-
pop ds # get back old data segment
58-
sti
59-
60-
# back to real mode, but internal data segment register is still loaded
61-
# with gdt segment -> we can access the full 4GiB of memory
62-
63-
mov bx, 0x0f01 # attrib/char of smiley
64-
mov eax, 0xb8f00 # note 32 bit offset
65-
mov word ptr ds:[eax], bx
66-
6733
check_int13h_extensions:
6834
push 'y' # error code
6935
mov ah, 0x41
@@ -82,29 +48,3 @@ spin:
8248
hlt
8349
jmp spin
8450

85-
gdt32info:
86-
.word gdt32_end - gdt32 - 1 # last byte in table
87-
.word gdt32 # start of table
88-
89-
gdt32:
90-
# entry 0 is always unused
91-
.quad 0
92-
codedesc:
93-
.byte 0xff
94-
.byte 0xff
95-
.byte 0
96-
.byte 0
97-
.byte 0
98-
.byte 0x9a
99-
.byte 0xcf
100-
.byte 0
101-
datadesc:
102-
.byte 0xff
103-
.byte 0xff
104-
.byte 0
105-
.byte 0
106-
.byte 0
107-
.byte 0x92
108-
.byte 0xcf
109-
.byte 0
110-
gdt32_end:

0 commit comments

Comments
 (0)