Don't create fake dos partitions for TEMP
This commit is contained in:
@@ -60,14 +60,11 @@ void bootmain (void) {
|
|||||||
devices_init ();
|
devices_init ();
|
||||||
vfs_init ();
|
vfs_init ();
|
||||||
|
|
||||||
struct device* ramdisk = device_find ("RD");
|
struct device* rd0 = device_find ("RD0");
|
||||||
vfs_create_volume ("RD", FS_TARFS, ramdisk, false);
|
vfs_create_volume ("RD", FS_TARFS, rd0, false);
|
||||||
|
|
||||||
struct device* temp = device_find ("TEMP");
|
struct device* temp0 = device_find ("TEMP0");
|
||||||
device_probe_partitions (temp);
|
int x = vfs_create_volume ("TEMP", FS_FAT16, temp0, true);
|
||||||
|
|
||||||
struct device* tempp0 = device_find ("TEMPp0");
|
|
||||||
int x = vfs_create_volume ("TEMP", FS_FAT16, tempp0, true);
|
|
||||||
|
|
||||||
proc_pid_alloc_init ();
|
proc_pid_alloc_init ();
|
||||||
procgroup_pgid_alloc_init ();
|
procgroup_pgid_alloc_init ();
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ void ramdisk_device_init (void) {
|
|||||||
.sector_size = 512,
|
.sector_size = 512,
|
||||||
.buffer = unpack_buffer,
|
.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);
|
LZ4F_freeDecompressionContext (dctx);
|
||||||
}
|
}
|
||||||
@@ -149,25 +149,7 @@ void temp_device_init (void) {
|
|||||||
.total_size = 1024 * 1024 * 20,
|
.total_size = 1024 * 1024 * 20,
|
||||||
.sector_size = 512,
|
.sector_size = 512,
|
||||||
};
|
};
|
||||||
|
device_create ("TEMP0", ops, lengthof (ops), &ramdrv_init, &ramdrv_fini, &init);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__x86_64__)
|
#if defined(__x86_64__)
|
||||||
|
|||||||
Reference in New Issue
Block a user