mirror of
https://git.checksum.fail/alec/bmik.git
synced 2025-12-15 15:39:59 +02:00
Add files to repository
This commit is contained in:
26
Src/BootHelper.HC
Normal file
26
Src/BootHelper.HC
Normal file
@@ -0,0 +1,26 @@
|
||||
// This script will clean up non-existent removable drives when booting in QEMU
|
||||
|
||||
U0 BootHelper() {
|
||||
I64 i;
|
||||
Bool is_qemu = FALSE;
|
||||
U8 *drv_model = DrvModelNum(':');
|
||||
if (!MemCmp("QEMU", drv_model, 4))
|
||||
is_qemu = TRUE;
|
||||
Free(drv_model);
|
||||
if (is_qemu) {
|
||||
// Remove non-existent removable drives
|
||||
for (i = 'T'; i < 'X'; i++) {
|
||||
if (Let2Drv(i, 0))
|
||||
DrvDel(Let2Drv(i));
|
||||
}
|
||||
// Add default QEMU CDROM
|
||||
CBlkDev *bd = CAlloc(sizeof(CBlkDev));
|
||||
bd = BlkDevNextFreeSlot('T', 5);
|
||||
bd->unit = 0;
|
||||
bd->base0 = 0x170;
|
||||
bd->base1 = 0x374;
|
||||
BlkDevAdd(bd, , 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
BootHelper;
|
||||
Reference in New Issue
Block a user