david/ipxe
Archived
1
0

Define BIOS data segment in bios.h

This commit is contained in:
Michael Brown 2006-05-13 11:43:07 +00:00
parent a27defa483
commit d822b3d4cd
2 changed files with 9 additions and 7 deletions

View File

@ -3,10 +3,9 @@
* Body of routines taken from old pcbios.S * Body of routines taken from old pcbios.S
*/ */
#include "stdint.h" #include <stdint.h>
#include "realmode.h" #include <realmode.h>
#include <bios.h>
#define BIOS_DATA_SEG 0x0040
#define CF ( 1 << 0 ) #define CF ( 1 << 0 )
@ -39,12 +38,12 @@ unsigned long currticks ( void ) {
IN_CONSTRAINTS (), IN_CONSTRAINTS (),
CLOBBER ( "eax" ) ); /* can't have an empty clobber list */ CLOBBER ( "eax" ) ); /* can't have an empty clobber list */
get_real ( ticks, BIOS_DATA_SEG, 0x006c ); get_real ( ticks, BDA_SEG, 0x006c );
get_real ( midnight, BIOS_DATA_SEG, 0x0070 ); get_real ( midnight, BDA_SEG, 0x0070 );
if ( midnight ) { if ( midnight ) {
midnight = 0; midnight = 0;
put_real ( midnight, BIOS_DATA_SEG, 0x0070 ); put_real ( midnight, BDA_SEG, 0x0070 );
days += 0x1800b0; days += 0x1800b0;
} }
return ( days + ticks ); return ( days + ticks );

View File

@ -1,6 +1,9 @@
#ifndef BIOS_H #ifndef BIOS_H
#define BIOS_H #define BIOS_H
#define BDA_SEG 0x0040
#define BDA_NUM_DRIVES 0x0075
extern unsigned long currticks ( void ); extern unsigned long currticks ( void );
extern void cpu_nap ( void ); extern void cpu_nap ( void );