X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fstartup.s;h=ef3cd38b443a03e5f435f420cd841d987ac70012;hb=5e8cc93aaf1173688852acaa0825698c2dc0cb3f;hp=4e3238981398839a986ff70867e80c0a7384857a;hpb=d1e8a437c1fab4535f82c4c214ec3330ac32e48d;p=bootcensus diff --git a/src/startup.s b/src/startup.s index 4e32389..ef3cd38 100644 --- a/src/startup.s +++ b/src/startup.s @@ -20,11 +20,18 @@ .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 + cli + 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 @@ -38,6 +45,8 @@ skip_bss_zero: .global logohack logohack: + pusha + # copy palette mov $logo_pal, %esi xor %cl, %cl @@ -127,16 +136,18 @@ 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