popl %ebp
ret
- /*
- * grub_getrtsecs()
- * if a seconds value can be read, read it and return it (BCD),
- * otherwise return 0xFF
- * BIOS call "INT 1AH Function 02H" to check whether a character is pending
- * Call with %ah = 0x2
- * Return:
- * If RT Clock can give correct values
- * %ch = hour (BCD)
- * %cl = minutes (BCD)
- * %dh = seconds (BCD)
- * %dl = daylight savings time (00h std, 01h daylight)
- * Carry flag = clear
- * else
- * Carry flag = set
- * (this indicates that the clock is updating, or
- * that it isn't running)
- */
- FUNCTION(grub_getrtsecs)
- pushl %ebp
-
- call prot_to_real /* enter real mode */
- .code16
-
- clc
- movb $0x2, %ah
- int $0x1a
-
- DATA32 jnc gottime
- movb $0xff, %dh
-
- gottime:
- DATA32 call real_to_prot
- .code32
-
- movb %dh, %al
-
- popl %ebp
- ret
--
-pxe_rm_entry:
- .long 0
--
/*
- * struct grub_pxenv *grub_pxe_scan (void);
+ * grub_get_rtc()
+ * return the real time in ticks, of which there are about
+ * 18-20 per second
*/
-FUNCTION(grub_pxe_scan)
+FUNCTION(grub_get_rtc)
pushl %ebp
- pushl %ebx
- xorl %ebx, %ebx
- xorl %ecx, %ecx
-
- call prot_to_real
+ call prot_to_real /* enter real mode */
.code16
- pushw %es
-
- movw $0x5650, %ax
- int $0x1A
- cmpw $0x564E, %ax
- jnz 1f
- cmpl $0x4E455850, %es:(%bx) /* PXEN(V+) */
- jnz 1f
- cmpw $0x201, %es:6(%bx) /* API version */
- jb 1f
- lesw %es:0x28(%bx), %bx /* !PXE structure */
- cmpl $0x45585021, %es:(%bx) /* !PXE */
- jnz 1f
- movw %es, %cx
- jmp 2f
-1:
- xorw %bx, %bx
- xorw %cx, %cx
-2:
-
- popw %es
+ /* %ax is already zero */
+ int $0x1a
- DATA32 call real_to_prot
+ DATA32 call real_to_prot
.code32
- xorl %eax, %eax
- leal (%eax, %ecx, 4), %ecx
- leal (%ebx, %ecx, 4), %eax /* eax = ecx * 16 + ebx */
-
- orl %eax, %eax
- jz 1f
-
- movl 0x10(%eax), %ecx
- movl %ecx, pxe_rm_entry
-
-1:
+ movl %ecx, %eax
+ shll $16, %eax
+ movw %dx, %ax
- popl %ebx
popl %ebp
ret