Don't create fake dos partitions for TEMP
This commit is contained in:
@@ -131,7 +131,7 @@ void ramdisk_device_init (void) {
|
||||
.sector_size = 512,
|
||||
.buffer = unpack_buffer,
|
||||
};
|
||||
device_create ("RD", ops, lengthof (ops), &ramdrv_init, &ramdrv_fini, &init);
|
||||
device_create ("RD0", ops, lengthof (ops), &ramdrv_init, &ramdrv_fini, &init);
|
||||
|
||||
LZ4F_freeDecompressionContext (dctx);
|
||||
}
|
||||
@@ -149,25 +149,7 @@ void temp_device_init (void) {
|
||||
.total_size = 1024 * 1024 * 20,
|
||||
.sector_size = 512,
|
||||
};
|
||||
|
||||
struct dos_mbr mbr;
|
||||
memset (&mbr, 0, sizeof (mbr));
|
||||
|
||||
mbr.valid_sign[0] = 0x55;
|
||||
mbr.valid_sign[1] = 0xAA;
|
||||
mbr.ptes[0].drive_attrs = (1 << 7);
|
||||
mbr.ptes[0].start_lba = 1;
|
||||
mbr.ptes[0].sector_count = div_align_up (init.total_size, init.sector_size) - 1;
|
||||
|
||||
struct device* temp =
|
||||
device_create ("TEMP", ops, lengthof (ops), &ramdrv_init, &ramdrv_fini, &init);
|
||||
|
||||
size_t sector = 0;
|
||||
size_t sector_count = 1;
|
||||
|
||||
spin_lock (&temp->lock);
|
||||
device_op (temp, XDRV_WRITE, NULL, NULL, §or, §or_count, &mbr);
|
||||
spin_unlock (&temp->lock);
|
||||
device_create ("TEMP0", ops, lengthof (ops), &ramdrv_init, &ramdrv_fini, &init);
|
||||
}
|
||||
|
||||
#if defined(__x86_64__)
|
||||
|
||||
Reference in New Issue
Block a user