Переглянути джерело

Define BIOS data segment in bios.h

tags/v0.9.3
Michael Brown 18 роки тому
джерело
коміт
d822b3d4cd

+ 6
- 7
src/arch/i386/firmware/pcbios/bios.c Переглянути файл

@@ -3,10 +3,9 @@
3 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 10
 #define CF ( 1 << 0 )
12 11
 
@@ -39,12 +38,12 @@ unsigned long currticks ( void ) {
39 38
 		    IN_CONSTRAINTS (),
40 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 44
 	if ( midnight ) {
46 45
 		midnight = 0;
47
-		put_real ( midnight, BIOS_DATA_SEG, 0x0070 );
46
+		put_real ( midnight, BDA_SEG, 0x0070 );
48 47
 		days += 0x1800b0;
49 48
 	}
50 49
 	return ( days + ticks );

+ 3
- 0
src/arch/i386/include/bios.h Переглянути файл

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

Завантаження…
Відмінити
Зберегти