summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Maiolino <[email protected]>2025-07-17 19:20:25 +0200
committerCarlos Maiolino <[email protected]>2025-07-17 19:20:25 +0200
commit92ee05c13b207c953e7d2fb0217caa3344318467 (patch)
tree4962beb8efc1d9275ba972afbcbcca23b220329a
parentd2e0328a408edd899748cf33f1e064719d163f30 (diff)
Prepare for enabling protected mode
Clean up all testing/playground code to prepare the bootloader to enable protected mode. Signed-off-by: Carlos Maiolino <[email protected]>
-rw-r--r--bootloader.asm42
1 files changed, 1 insertions, 41 deletions
diff --git a/bootloader.asm b/bootloader.asm
index 40bf2b6..bf3afb4 100644
--- a/bootloader.asm
+++ b/bootloader.asm
@@ -27,40 +27,10 @@ step2:
; Intel implements a full descending stack
sti ; Enable interrupts
-
- mov si, load_msg
- call print
-
- ; Load sector from disk
-
- mov ah, 2 ; Read sector into memory
- mov al, 1 ; Read 1 sector
-
- mov ch, 0 ; Cylinder number
- mov cl, 2 ; Sector number to start reading from
-
- mov dh, 0 ; Head number
- ;DL ; Drive number (Already set by bios)
-
- ; Sector will be loaded at ES:BX. We already have ES set,
- ; just set the BX to an address after the end of the bootloader. This
- ; avoids the risk of corrupting any data from our bootloader.
- mov bx, kbuf_sector
- int 0x13
-
- ; Jump if CF is set
- jc kload_failure ; On I/O error, CF is set
-
- ; Kernel loaded succesfully (hopefully)
- mov si, kbuf_sector
- call print
jmp $
-kload_failure:
- mov si, err_msg
- call print
- jmp $
+; Message Print routines
print:
mov bx, 0
.loop
@@ -77,16 +47,6 @@ print_char:
int 0x10
ret
-
-; Static data
- load_msg: db 'Starting bootloader...', 0x0A, 0x0D, 0
- divzero_msg: db 'Interrupts working properly...', 0x0A, 0x0D, 0
- err_msg: db 'Failed to load kernel...', 0x0A, 0x0D, 0
-
; Fill in to the end and add bootloader signature
times 510 - ($ - $$) db 0
dw 0xAA55
-
-; This just labels an address after the bootloader. Just makes it easier
-; to refer to the loaded sector from int 0x13.
-kbuf_sector: