X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fstartup.s;h=0a36b67c67623d79ad8294191e7679c42396da4d;hb=5a961b914da78d534e8e2dc6bfb5103114dbff54;hp=42e4b21107d0dacf2519e90b8ef94ed538219b06;hpb=eb934abaf0dcfa48589c6ac15f2a2ff235c5aea0;p=bootcensus diff --git a/src/startup.s b/src/startup.s index 42e4b21..0a36b67 100644 --- a/src/startup.s +++ b/src/startup.s @@ -15,19 +15,37 @@ # along with this program. If not, see . .code32 - .section .startup + .section .startup,"ax" .extern _bss_start .extern _bss_end + .extern pcboot_main + .extern wait_vsync + .extern kb_getkey + # move the stack to the top of the conventional memory + movl $0x80000, %esp + + # zero the BSS section xor %eax, %eax - mov _bss_start, %edi - mov _bss_size, %ecx + mov $_bss_start, %edi + mov $_bss_size, %ecx + cmp $0, %ecx + jz skip_bss_zero shr $4, %ecx rep stosl +skip_bss_zero: + call pcboot_main + # pcboot_main never returns +0: cli + hlt + jmp 0b + .global logohack logohack: + pusha + # copy palette mov $logo_pal, %esi xor %cl, %cl @@ -117,22 +135,22 @@ xloop: incl frameno - # wait vsync - mov $0x3da, %dx -0: in %dx, %al - and $8, %al - jnz 0b -0: in %dx, %al - and $8, %al - jz 0b + call wait_vsync + + # check for escape keypress + call kb_getkey + cmp $27, %eax + jz 0f + jmp frameloop +0: popa + ret + xval: .long 0 yval: .long 0 frameno: .long 0 -numbuf: .space 16 - logo_pal: .incbin "logo.pal"