Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;
- ; boot_sec.s
- ; HADES OS
- ;
- ; Created by Aung Khant Min on 7/14/18.
- ;
- [bits 16]
- [org 0x7c00]
- KERNEL_OFFSET equ 0x1000
- xor ax, ax
- mov ds, ax
- mov es, ax
- mov [BOOT_DRIVE], dl
- mov ax,0x07E
- cli
- mov ss, ax
- mov sp, 0x1200
- sti
- mov bx, MSG_REAL_MODE
- call print
- call load_kernel
- call switch_to_pm
- jmp $
- %include "./rm/print_func.asm"
- %include "./rm/disk_load.s"
- %include "./pm/global_descriptor_table.asm"
- %include "./pm/print_string_pm.asm"
- %include "./pm/swith_to_pm.asm"
- [bits 16]
- load_kernel:
- mov bx, LOAD_KERNEL_MSG
- call print
- mov bx, KERNEL_OFFSET
- mov dh, 15
- mov dl, [BOOT_DRIVE]
- call disk_load
- ret
- [bits 32]
- BEGIN_PM:
- mov ebx, MSG_PROT_MODE
- call print_string_pm
- call KERNEL_OFFSET
- jmp $
- BOOT_DRIVE db 0
- SECTORS db 0
- MSG_REAL_MODE db "Started in 16-bit Real Mode.", 0
- LOAD_KERNEL_MSG db "Loading kernel into memory.", 0
- MSG_PROT_MODE db "Successfully landed in 32-bit Protected Mode", 0
- times 510-($-$$) db 0
- dw 0xaa55
- ;times 15*256 dw 0xDADA
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement