mirror of
https://github.com/cfenollosa/os-tutorial.git
synced 2025-12-17 20:34:36 +03:00
lessons 8, 9, 10, entering 32-bit mode
This commit is contained in:
27
10-32bit-enter/32bit-main.asm
Normal file
27
10-32bit-enter/32bit-main.asm
Normal file
@@ -0,0 +1,27 @@
|
||||
[org 0x7c00] ; bootloader offset
|
||||
mov bp, 0x9000 ; set the stack
|
||||
mov sp, bp
|
||||
|
||||
mov bx, MSG_REAL_MODE
|
||||
call print ; This will be written after the BIOS messages
|
||||
|
||||
call switch_to_pm
|
||||
jmp $ ; this will actually never be executed
|
||||
|
||||
%include "../05-bootsector-functions-strings/boot_sect_print.asm"
|
||||
%include "../09-32bit-gdt/32bit-gdt.asm"
|
||||
%include "../08-32bit-print/32bit-print.asm"
|
||||
%include "32bit-switch.asm"
|
||||
|
||||
[bits 32]
|
||||
BEGIN_PM: ; after the switch we will get here
|
||||
mov ebx, MSG_PROT_MODE
|
||||
call print_string_pm ; Note that this will be written at the top left corner
|
||||
jmp $
|
||||
|
||||
MSG_REAL_MODE db "Started in 16-bit real mode", 0
|
||||
MSG_PROT_MODE db "Loaded 32-bit protected mode", 0
|
||||
|
||||
; bootsector
|
||||
times 510-($-$$) db 0
|
||||
dw 0xaa55
|
||||
Reference in New Issue
Block a user