Restore install-drive functionality, remove legacy IDE fields and padding from CBlkDev and CBlkDevGlobals, add ins_port AHCI member and use it to replace IDE fields.

This commit is contained in:
TomAwezome 2021-12-04 05:31:11 -05:00
parent b6496c9378
commit 1b2144c451
11 changed files with 25 additions and 63 deletions

Binary file not shown.

View file

@ -1,4 +1,9 @@
$WW,1$$FG,5$$TX+CX,"ChangeLog"$$FG$ $WW,1$$FG,5$$TX+CX,"ChangeLog"$$FG$
$IV,1$----12/04/21 04:16:45----$IV,0$
* Raised version number to 1.06.
* Removed IDE members and padding from CBlkDev and CBlkDevGlobals, added $MA-X+PU,"ins_port",LM="Find(\"ins_port\",\"/*\");View;"$ to return install-drive recognition functionality.
* Implemented $LK+PU,"BlkDevRep",A="MN:BlkDevRep"$, removed BlkDevRep demo file.
$IV,1$----11/30/21 13:40:29----$IV,0$ $IV,1$----11/30/21 13:40:29----$IV,0$
* Raised version number to 1.05. * Raised version number to 1.05.
* $LK,"R",A="MN:R"$("DocDump", "$LK+PU,"DocDumpLines",A="MN:DocDumpLines"$"); * $LK,"R",A="MN:R"$("DocDump", "$LK+PU,"DocDumpLines",A="MN:DocDumpLines"$");

View file

@ -1065,7 +1065,7 @@ U0 AHCIInit()
CAHCIPort *port; CAHCIPort *port;
I64 i, bdf; I64 i, bdf;
"トトトトトトトトトトトトトトトトトトトトトト\n"; "______________________\n";
bdf = PCIClassFind(PCIC_STORAGE << 16 | PCISC_AHCI << 8 + 1, 0); //0x010601, last byte prog_if, AHCI version 1.0 bdf = PCIClassFind(PCIC_STORAGE << 16 | PCISC_AHCI << 8 + 1, 0); //0x010601, last byte prog_if, AHCI version 1.0
@ -1125,7 +1125,7 @@ U0 AHCIInit()
"Unknown\n"; "Unknown\n";
} }
} }
"トトトトトトトトトトトトトトトトトトトトトト\n\n"; "______________________\n\n";
} }
Bool AHCIBootDVDProbeAll(CBlkDev *bd) Bool AHCIBootDVDProbeAll(CBlkDev *bd)
@ -1135,7 +1135,7 @@ Bool AHCIBootDVDProbeAll(CBlkDev *bd)
U8 *buf = CAlloc(DVD_BLK_SIZE); U8 *buf = CAlloc(DVD_BLK_SIZE);
CKernel *kernel; CKernel *kernel;
"トトトトトトトトトトトトトトトトトトトトトト\n"; "______________________\n";
for (i = 0; i < AHCI_MAX_PORTS; i++) for (i = 0; i < AHCI_MAX_PORTS; i++)
{ {
@ -1165,7 +1165,7 @@ Bool AHCIBootDVDProbeAll(CBlkDev *bd)
if (kernel->compile_time == sys_compile_time) if (kernel->compile_time == sys_compile_time)
{ {
"AHCI: Found sys_compile_time at BLK %d on Port %d\n", sys_boot_blk, i; "AHCI: Found sys_compile_time at BLK %d on Port %d\n", sys_boot_blk, i;
"トトトトトトトトトトトトトトトトトトトトトト\n"; "______________________\n";
return TRUE; return TRUE;
} }
else else

View file

@ -1,38 +1,3 @@
/* // TODO: use this for reference in SATARep when fixing AHCI's lack of blkdev.ins_unit, etc
U0 ATARepEntry(I64 base0, I64 base1, I64 unit, U8 *message, CATARep **_head, I64 *num_hints)
{
I64 type;
base0 &= -8;
base1 &= -4;
CATARep *tmpha;
if (type = IDEATAProbe(base0,base1,unit))
{
*num_hints += 1;
"\n$$PURPLE$$ $$BT+X,\"%d\",LM=\"%d\\n\"$$$$FG$$$$LM,4$$", *num_hints, *num_hints;
if (type == BDT_ATA)
"$$RED$$Hard Drive $$LTBLUE$$ATA ";
else
"$$RED$$CD/DVD Drive $$LTBLUE$$ATAPI ";
"%s$$FG$$\n", message;
if (base0 == blkdev.ins_base0 && unit == blkdev.ins_unit)
"$$PURPLE$$(Drive originally installed from.)$$FG$$\n";
"Base0:0x%04X Base1:0x%04X Unit:%d$$LM,0$$\n", base0, base1, unit;
if (_head)
{
tmpha = CAlloc(sizeof(CATARep));
tmpha->next = *_head;
*_head = tmpha;
tmpha->num = *num_hints;
tmpha->type = type;
tmpha->base0 = base0;
tmpha->base1 = base1;
tmpha->unit = unit;
}
}
}
*/
CBlkDev *ATAMount(U8 first_drive_let, I64 type, I64 port_num) CBlkDev *ATAMount(U8 first_drive_let, I64 type, I64 port_num)
{ {
CBlkDev *res; CBlkDev *res;

View file

@ -20,7 +20,7 @@ U0 BlkDevLockFwdingSet(CBlkDev *bd)
bd1 = &blkdev.blkdevs[i]; bd1 = &blkdev.blkdevs[i];
if (bd1->bd_signature == BD_SIGNATURE_VAL && bd != bd1 && if (bd1->bd_signature == BD_SIGNATURE_VAL && bd != bd1 &&
(bd1->type == BDT_ATAPI || bd1->type == BDT_ATA) && (bd1->type == BDT_ATAPI || bd1->type == BDT_ATA) &&
bd1->base0 == bd->base0) bd1->port_num == bd->port_num)
{ {
bd->lock_fwding = bd1; bd->lock_fwding = bd1;
break; break;

View file

@ -722,7 +722,7 @@ U0 Fault2(I64 fault_num, I64 fault_err_code)
was_mouse_enabled = CallExtStr("MouseHardEnable", FALSE); was_mouse_enabled = CallExtStr("MouseHardEnable", FALSE);
was_raw = Raw(ON); was_raw = Raw(ON);
was_silent = Silent(OFF); was_silent = Silent(OFF);
text.raw_flags |= RAWF_SHOW_DOLLAR|RAWF_SCROLL; text.raw_flags |= RAWF_SHOW_DOLLAR | RAWF_SCROLL;
"Task \""; "Task \"";
"%s", Fs->task_title; "%s", Fs->task_title;

View file

@ -13,7 +13,7 @@ CTask *sys_winmgr_task,
U8 *rev_bits_table; //Table with U8 bits reversed U8 *rev_bits_table; //Table with U8 bits reversed
CDate local_time_offset; CDate local_time_offset;
F64 *pow10_I64, F64 *pow10_I64,
sys_os_version = 1.05; sys_os_version = 1.06;
CAutoCompleteDictGlobals acd; CAutoCompleteDictGlobals acd;
CAutoCompleteGlobals ac; CAutoCompleteGlobals ac;

View file

@ -167,7 +167,7 @@ U0 KMain()
//to debug. After this point, use $LK,"RawPrint",A="MN:RawPrint"$() //to debug. After this point, use $LK,"RawPrint",A="MN:RawPrint"$()
LBts(&sys_run_level, RLf_RAW); LBts(&sys_run_level, RLf_RAW);
"\nZealOS V%0.2f\t%D %T\n", sys_os_version, sys_compile_time, sys_compile_time; "\nZealOS V%0.2f\t%D %T\n", sys_os_version, sys_compile_time, sys_compile_time;
"ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ\n\n"; "_________________________________\n\n";
"TimerInit;\n"; "TimerInit;\n";
TimerInit; TimerInit;
@ -194,11 +194,9 @@ U0 KMain()
#exe #exe
{ {
StreamPrint("HomeSet(\"%s\");\n" StreamPrint("HomeSet(\"%s\");\n"
"blkdev.ins_base0 = %d;" "blkdev.ins_port = %d;",
"blkdev.ins_base1 = %d;"
"blkdev.ins_unit = %d;\n",
kernel_config->home_dir, kernel_config->home_dir,
blkdev.ins_base0, blkdev.ins_base1, blkdev.ins_unit); blkdev.ins_port);
} }
Gs->idle_task->cur_dv = blkdev.let_to_drive[*blkdev.home_dir - 'A']; Gs->idle_task->cur_dv = blkdev.let_to_drive[*blkdev.home_dir - 'A'];
@ -206,11 +204,8 @@ U0 KMain()
if (blkdev.dvd_boot_is_good) if (blkdev.dvd_boot_is_good)
{ {
bd = Letter2BlkDev(':'); bd = Letter2BlkDev(':');
if (bd->type == BDT_ATAPI) { if (bd->type == BDT_ATAPI)
blkdev.ins_base0 = bd->base0; blkdev.ins_port = bd->port_num;
blkdev.ins_base1 = bd->base1;
blkdev.ins_unit = bd->unit;
}
} }
LBts(&sys_run_level, RLf_BLKDEV); LBts(&sys_run_level, RLf_BLKDEV);

View file

@ -3317,16 +3317,12 @@ public class CBlkDev
CAHCIPort *ahci_port; CAHCIPort *ahci_port;
U8 *prd_buf, U8 *prd_buf,
first_drive_let, first_drive_let,
unit,
pad[2],
*RAM_disk, *RAM_disk,
*file_disk_name; *file_disk_name;
CFile *file_disk; CFile *file_disk;
U32 bd_signature, U32 bd_signature,
type, type,
flags, flags,
base0,
base1,
blk_size, blk_size,
max_reads, max_reads,
max_writes; max_writes;
@ -3439,12 +3435,9 @@ public class CBlkDevGlobals
write_count, write_count,
mount_ide_auto_count, mount_ide_auto_count,
cmd_slot_count, cmd_slot_count,
ins_base0, ins_port;// Installed-from CD/DVD controller.
ins_base1; //Install cd/dvd controller.
Bool dvd_boot_is_good, Bool dvd_boot_is_good,
ahci64, ahci64;
ins_unit,
pad[2];
}; };
#help_index "File/Internal" #help_index "File/Internal"

View file

@ -104,6 +104,10 @@ public I64 SATARep(I64 bd_type=BDT_NULL)
Fs->catch_except = TRUE; Fs->catch_except = TRUE;
"Error at SATA Port %d", i; "Error at SATA Port %d", i;
} }
if (i == blkdev.ins_port)
"\t(Drive originally installed from.)\n";
"\n\t"; "\n\t";
if (temp_blkdev->dev_id_record) if (temp_blkdev->dev_id_record)

View file

@ -15,8 +15,8 @@ U0 LoadDocDefines()
//$LK,"DD_BOOT_HIGH_LOC_DVD",A="FF:::/System/Boot/BootDVD.CC,DD_BOOT_HIGH_LOC_DVD"$ //$LK,"DD_BOOT_HIGH_LOC_DVD",A="FF:::/System/Boot/BootDVD.CC,DD_BOOT_HIGH_LOC_DVD"$
$TR,"LineRep"$ $TR,"LineRep"$
$ID,2$DefinePrint("DD_ZEALOS_LOC","95,267"); $ID,2$DefinePrint("DD_ZEALOS_LOC","95,255");
$ID,-2$ $ID,-2$
DefinePrint("DD_MP_VECT", "%08X", MP_VECT_ADDR); DefinePrint("DD_MP_VECT", "%08X", MP_VECT_ADDR);
DefinePrint("DD_MP_VECT_END", "%08X", MP_VECT_ADDR + COREAP_16BIT_INIT_END - COREAP_16BIT_INIT - 1); DefinePrint("DD_MP_VECT_END", "%08X", MP_VECT_ADDR + COREAP_16BIT_INIT_END - COREAP_16BIT_INIT - 1);