Browse Source

Add INT 13,41 (extensions installation check). LILO's MBR now uses

linear calls to load the MS-DOS boot sector in my test setup.
tags/v0.9.3
Michael Brown 18 years ago
parent
commit
295e11b2b0
2 changed files with 40 additions and 0 deletions
  1. 16
    0
      src/arch/i386/include/int13.h
  2. 24
    0
      src/arch/i386/interface/pcbios/int13.c

+ 16
- 0
src/arch/i386/include/int13.h View File

@@ -27,6 +27,8 @@ struct block_device;
27 27
 #define INT13_WRITE_SECTORS		0x03
28 28
 /** Get drive parameters */
29 29
 #define INT13_GET_PARAMETERS		0x08
30
+/** Extensions installation check */
31
+#define INT13_EXTENSION_CHECK		0x41
30 32
 /** Extended read */
31 33
 #define INT13_EXTENDED_READ		0x42
32 34
 /** Extended write */
@@ -151,6 +153,20 @@ struct int13_disk_parameters {
151 153
 
152 154
 /** @} */
153 155
 
156
+/**
157
+ * @defgroup int13exts INT 13 extension flags
158
+ * @{
159
+ */
160
+
161
+/** Extended disk access functions supported */
162
+#define INT13_EXTENSION_LINEAR		0x01
163
+/** Removable drive functions supported */
164
+#define INT13_EXTENSION_REMOVABLE	0x02
165
+/** EDD functions supported */
166
+#define INT13_EXTENSION_EDD		0x04
167
+
168
+/** @} */
169
+
154 170
 extern void register_int13_drive ( struct int13_drive *drive );
155 171
 extern void unregister_int13_drive ( struct int13_drive *drive );
156 172
 extern int int13_boot ( unsigned int drive );

+ 24
- 0
src/arch/i386/interface/pcbios/int13.c View File

@@ -267,6 +267,27 @@ static int int13_get_parameters ( struct int13_drive *drive,
267 267
 	return 0;
268 268
 }
269 269
 
270
+/**
271
+ * INT 13, 41 - Extensions installation check
272
+ *
273
+ * @v drive		Emulated drive
274
+ * @v bx		0x55aa
275
+ * @ret bx		0xaa55
276
+ * @ret cx		Extensions API support bitmap
277
+ * @ret status		Status code
278
+ */
279
+static int int13_extension_check ( struct int13_drive *drive __unused,
280
+				   struct i386_all_regs *ix86 ) {
281
+	if ( ix86->regs.bx == 0x55aa ) {
282
+		DBG ( "INT 13 extensions installation check\n" );
283
+		ix86->regs.bx = 0xaa55;
284
+		ix86->regs.cx = INT13_EXTENSION_LINEAR;
285
+		return 0;
286
+	} else {
287
+		return INT13_STATUS_INVALID;
288
+	}
289
+}
290
+
270 291
 /**
271 292
  * INT 13, 42 - Extended read
272 293
  *
@@ -357,6 +378,9 @@ static void int13 ( struct i386_all_regs *ix86 ) {
357 378
 		case INT13_GET_PARAMETERS:
358 379
 			status = int13_get_parameters ( drive, ix86 );
359 380
 			break;
381
+		case INT13_EXTENSION_CHECK:
382
+			status = int13_extension_check ( drive, ix86 );
383
+			break;
360 384
 		case INT13_EXTENDED_READ:
361 385
 			status = int13_extended_read ( drive, ix86 );
362 386
 			break;

Loading…
Cancel
Save