Skip to content

Small optimizations #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions 6/6.asm
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
[org 0x7c00]


mov [BOOT_DISK], dl



; defines the constant code and data segments
CODE_SEG equ GDT_code - GDT_start
DATA_SEG equ GDT_data - GDT_start

cli
lgdt [GDT_descriptor]

mov eax, cr0
or eax, 1
mov cr0, eax


; far jump to our labe;
jmp CODE_SEG:start_protected_mode

jmp $


jmp $

GDT_start: ; must be at the end of real mode code
GDT_null:
dd 0x0
Expand All @@ -42,8 +42,8 @@ GDT_start: ; must be at the end of real mode code
GDT_end:

GDT_descriptor:
dw GDT_end - GDT_start - 1
dd GDT_start
dw GDT_end - GDT_start - 1 ; size
dd GDT_start ; location


[bits 32]
Expand All @@ -53,7 +53,9 @@ start_protected_mode:
mov [0xb8000], ax
jmp $

BOOT_DISK: db 0

times 510-($-$$) db 0
dw 0xaa55