reorganize source
[com32] / src / startup.asm
1         bits 32
2         section .text
3
4 %include 'macros.inc'
5
6         extern main
7         extern _bss_start
8         extern _bss_end
9
10         global startup
11 startup:
12         ; clear .bss
13         mov eax, _bss_end
14         sub eax, _bss_start
15         test eax, eax
16         jz .nobss
17         mov ecx, eax
18         mov edi, _bss_start
19         xor eax, eax
20         shr ecx, 2
21         rep stosd
22 .nobss:
23
24         xor ebp, ebp    ; terminate backtraces
25         call main
26         retf
27
28 ;       global putchar
29 ;putchar:
30 ;       mov eax, [esp + 4]
31 ;       cmp al, 10
32 ;       jnz .nonl
33 ;       push eax
34 ;       mov al, 13
35 ;       SER_PUTCHAR
36 ;       pop eax
37 ;.nonl: SER_PUTCHAR
38 ;       ret
39
40         section .data
41         global boot_mem_map_size
42         global boot_mem_map
43         align 4
44 boot_mem_map_size dd 0
45 boot_mem_map times 128 db 0
46
47 ; vi:set ts=8 sts=8 sw=8 ft=nasm: