2020-09-18 23:15:27 +03:00
|
|
|
extern bss_begin
|
|
|
|
extern bss_end
|
|
|
|
extern entry
|
2020-12-06 18:43:38 +03:00
|
|
|
extern gdt
|
2020-09-18 23:15:27 +03:00
|
|
|
|
|
|
|
section .entry
|
|
|
|
|
|
|
|
global _start
|
|
|
|
_start:
|
|
|
|
cld
|
|
|
|
|
|
|
|
; Zero out .bss
|
|
|
|
xor al, al
|
|
|
|
mov edi, bss_begin
|
|
|
|
mov ecx, bss_end
|
|
|
|
sub ecx, bss_begin
|
|
|
|
rep stosb
|
|
|
|
|
2020-12-06 18:43:38 +03:00
|
|
|
lgdt [gdt]
|
|
|
|
jmp 0x18:.reload_cs
|
|
|
|
.reload_cs:
|
|
|
|
mov eax, 0x20
|
|
|
|
mov ds, ax
|
|
|
|
mov es, ax
|
|
|
|
mov fs, ax
|
|
|
|
mov gs, ax
|
|
|
|
mov ss, ax
|
|
|
|
|
2020-09-18 23:15:27 +03:00
|
|
|
jmp entry
|