Don't create fake dos partitions for TEMP

This commit is contained in:
2026-03-10 21:07:09 +01:00
parent 4b099f04f5
commit e9806c862c
2 changed files with 6 additions and 27 deletions

View File

@@ -60,14 +60,11 @@ void bootmain (void) {
devices_init ();
vfs_init ();
struct device* ramdisk = device_find ("RD");
vfs_create_volume ("RD", FS_TARFS, ramdisk, false);
struct device* rd0 = device_find ("RD0");
vfs_create_volume ("RD", FS_TARFS, rd0, false);
struct device* temp = device_find ("TEMP");
device_probe_partitions (temp);
struct device* tempp0 = device_find ("TEMPp0");
int x = vfs_create_volume ("TEMP", FS_FAT16, tempp0, true);
struct device* temp0 = device_find ("TEMP0");
int x = vfs_create_volume ("TEMP", FS_FAT16, temp0, true);
proc_pid_alloc_init ();
procgroup_pgid_alloc_init ();

View File

@@ -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, &sector, &sector_count, &mbr);
spin_unlock (&temp->lock);
device_create ("TEMP0", ops, lengthof (ops), &ramdrv_init, &ramdrv_fini, &init);
}
#if defined(__x86_64__)