Browse Source

Define BIOS data segment in bios.h

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
d822b3d4cd
2 changed files with 9 additions and 7 deletions
  1. 6
    7
      src/arch/i386/firmware/pcbios/bios.c
  2. 3
    0
      src/arch/i386/include/bios.h

+ 6
- 7
src/arch/i386/firmware/pcbios/bios.c View File

3
  * Body of routines taken from old pcbios.S
3
  * Body of routines taken from old pcbios.S
4
  */
4
  */
5
 
5
 
6
-#include "stdint.h"
7
-#include "realmode.h"
8
-
9
-#define BIOS_DATA_SEG 0x0040
6
+#include <stdint.h>
7
+#include <realmode.h>
8
+#include <bios.h>
10
 
9
 
11
 #define CF ( 1 << 0 )
10
 #define CF ( 1 << 0 )
12
 
11
 
39
 		    IN_CONSTRAINTS (),
38
 		    IN_CONSTRAINTS (),
40
 		    CLOBBER ( "eax" ) ); /* can't have an empty clobber list */
39
 		    CLOBBER ( "eax" ) ); /* can't have an empty clobber list */
41
 
40
 
42
-	get_real ( ticks, BIOS_DATA_SEG, 0x006c );
43
-	get_real ( midnight, BIOS_DATA_SEG, 0x0070 );
41
+	get_real ( ticks, BDA_SEG, 0x006c );
42
+	get_real ( midnight, BDA_SEG, 0x0070 );
44
 
43
 
45
 	if ( midnight ) {
44
 	if ( midnight ) {
46
 		midnight = 0;
45
 		midnight = 0;
47
-		put_real ( midnight, BIOS_DATA_SEG, 0x0070 );
46
+		put_real ( midnight, BDA_SEG, 0x0070 );
48
 		days += 0x1800b0;
47
 		days += 0x1800b0;
49
 	}
48
 	}
50
 	return ( days + ticks );
49
 	return ( days + ticks );

+ 3
- 0
src/arch/i386/include/bios.h View File

1
 #ifndef BIOS_H
1
 #ifndef BIOS_H
2
 #define BIOS_H
2
 #define BIOS_H
3
 
3
 
4
+#define BDA_SEG 0x0040
5
+#define BDA_NUM_DRIVES 0x0075
6
+
4
 extern unsigned long currticks ( void );
7
 extern unsigned long currticks ( void );
5
 extern void cpu_nap ( void );
8
 extern void cpu_nap ( void );
6
 
9
 

Loading…
Cancel
Save