File tree Expand file tree Collapse file tree 1 file changed +0
-60
lines changed
real_mode/first_stage/src Expand file tree Collapse file tree 1 file changed +0
-60
lines changed Original file line number Diff line number Diff line change @@ -30,40 +30,6 @@ enable_a20:
30
30
out 0x92 , al
31
31
enable_a20_after:
32
32
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
-
67
33
check_int13h_extensions:
68
34
push 'y' # error code
69
35
mov ah , 0x41
82
48
hlt
83
49
jmp spin
84
50
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:
You can’t perform that action at this time.
0 commit comments