mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2025-04-15 04:08:38 +01:00
Fix AutoComplete standby formatting.
Remove some unneeded IDE functions. Clean up Mount2(). Alter window border chars in Std Font, patch Aux Font. Alter window scroll bar drawing routine. Make System Task window smaller by default. Implement default args for Ed and PopUpEd. Add color to '[X]' and 'MENU' in window border top, remove both from System task and remove 'MENU' from AutoComplete task.
This commit is contained in:
parent
76ee6ec6a2
commit
ef85d8d6bf
30 changed files with 187 additions and 552 deletions
Binary file not shown.
BIN
src/Doc/Boot.DD
BIN
src/Doc/Boot.DD
Binary file not shown.
|
@ -1,4 +1,10 @@
|
|||
$WW,1$$FG,5$$TX+CX,"ChangeLog"$$FG$
|
||||
$IV,1$----07/02/21 19:30:19----$IV,0$
|
||||
* Raised version number to 0.04.
|
||||
* Implemented default NULL filename args for $LK+PU,"Ed",A="FF:::/System/DolDoc/DocEd.CC,Ed(U"$, $LK+PU,"PopUpEd",A="FF:::/System/DolDoc/DocEd.CC,PopUpEd(U"$.
|
||||
* Removed some deprecated IDE functions.
|
||||
* Changed window borders. Added color to $LK+PU,"[X]",A="FF:::/System/DolDoc/DocTerm.CC,[X]"$ and $LK+PU,"MENU",A="FF:::/System/DolDoc/DocTerm.CC,MENU"$, hide for System Task and AutoComplete Task.
|
||||
|
||||
$IV,1$----07/02/21 03:58:09----$IV,0$
|
||||
* Raised version number to 0.03.
|
||||
* Update all documentation, change 1st-person --> 3rd-person.
|
||||
|
|
|
@ -2,21 +2,22 @@ $FG,5$$TX+CX,"AutoComplete is in StandBy"$$FG$
|
|||
|
||||
$FG,4$$TX+CX+L+PU+UL,"System Keys Quick Guide",A="::/Doc/HelpIndex.DD"$$FG$
|
||||
$FG,4$$TX+CX,"(Works Everywhere)"$$FG$
|
||||
$FG,2$ <SPACE> $FG$ Left-Click
|
||||
$FG,2$ <ENTER> $FG$ Right-Click
|
||||
$FG,2$ <F1> $FG$ Help
|
||||
$FG,2$ <CTRL-m> $FG$ Personal Menu
|
||||
$FG,2$ <ESC> $FG$ Save & Exit
|
||||
$FG,2$ <SHIFT-ESC> $FG$ Abort & Exit
|
||||
$FG,2$ <CTRL-ALT-X> $FG$Kill Window
|
||||
$FG,2$ <CTRL-ALT-N> $FG$Focus Next Win
|
||||
$FG,2$ <WINDOWS> $FG$ Pull-Down Menu
|
||||
$FG,2$ <CTRL-D>$FG$ File Manager
|
||||
$FG,2$<CTRL-F>$FG$ Find
|
||||
$FG,2$ <ALT-M>$FG$ Max Window
|
||||
$FG,2$ <ALT-H>$FG$ Horz Tile
|
||||
$FG,2$ <ALT-V>$FG$ Vert Tile
|
||||
$FG,2$<CTRL-L>$FG$ Text Menu
|
||||
$FG,2$ <F7>$FG$ God Word
|
||||
$FG,2$ <SHIFT-F7>$FG$ God Passage
|
||||
$FG,2$<ALT-SHIFT-A>$FG$ Close AC
|
||||
$FG,2$ <SPACE>$FG$ Left-Click
|
||||
$FG,2$ <ENTER>$FG$ Right-Click
|
||||
$FG,2$ <F1>$FG$ Help
|
||||
$FG,2$ <CTRL-M>$FG$ Personal Menu
|
||||
$FG,2$ <ESC>$FG$ Save & Exit
|
||||
$FG,2$ <SHIFT-ESC>$FG$ Abort & Exit
|
||||
$FG,2$ <CTRL-ALT-X>$FG$ Kill Window
|
||||
$FG,2$ <CTRL-ALT-N>$FG$ Focus Next Win
|
||||
$FG,2$ <WINDOWS>$FG$ Pull-Down Menu
|
||||
$FG,2$ <CTRL-D>$FG$ File Manager
|
||||
$FG,2$ <CTRL-F>$FG$ Find
|
||||
$FG,2$ <ALT-M>$FG$ Max Window
|
||||
$FG,2$ <ALT-H>$FG$ Horz Tile
|
||||
$FG,2$ <ALT-V>$FG$ Vert Tile
|
||||
$FG,2$ <CTRL-L>$FG$ Text Menu
|
||||
$FG,2$ <F7>$FG$ God Word
|
||||
$FG,2$ <SHIFT-F7>$FG$ God Passage
|
||||
$FG,2$<SHIFT-ALT-A>$FG$ Close AC
|
||||
$FG,2$ <ALT-A>$FG$ Open AC
|
|
@ -856,7 +856,6 @@ Bool AHCIAtapiRBlks(CDrive *drive, U8 *buf, I64 blk, I64 count)
|
|||
|
||||
return TRUE;
|
||||
}
|
||||
//IDEATARBlks
|
||||
|
||||
Bool AHCIAtaRBlks(CDrive *drive, U8 *buf, I64 blk, I64 count)
|
||||
{
|
||||
|
|
|
@ -379,90 +379,6 @@ CATAPITrack *IDEATAPIReadTrackInfo(CBlkDev *bd, I64 blk)
|
|||
return res;
|
||||
}
|
||||
|
||||
Bool IDEATAInit(CBlkDev *bd)
|
||||
{
|
||||
Bool unlock = BlkDevLock(bd), okay = FALSE;
|
||||
|
||||
if (bd->type == BDT_ATAPI)
|
||||
bd->flags &= ~BDF_EXT_SIZE;
|
||||
else
|
||||
bd->flags |= BDF_EXT_SIZE;
|
||||
|
||||
if (IDEATAReadNativeMax(bd, tS + 0.1))
|
||||
{
|
||||
IDEATABlkSel(bd, bd->max_blk, 0);
|
||||
if (bd->flags & BDF_EXT_SIZE)
|
||||
IDEATACmd(bd, ATA_SET_MAX_EXT);
|
||||
else
|
||||
IDEATACmd(bd, ATA_SET_MAX);
|
||||
|
||||
if (IDEATAWaitNotBUSY(bd, 0))
|
||||
{
|
||||
okay = TRUE;
|
||||
if (bd->type == BDT_ATAPI)
|
||||
{
|
||||
if (IDEATAPIStartStop(bd, 0, TRUE))
|
||||
{
|
||||
if (!IDEATAPISetMaxSpeed(bd))
|
||||
okay = FALSE;
|
||||
}
|
||||
else
|
||||
okay = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (unlock)
|
||||
BlkDevUnlock(bd);
|
||||
|
||||
return okay;
|
||||
}
|
||||
|
||||
Bool IDEATAPIWaitReady(CBlkDev *bd, F64 timeout)
|
||||
{
|
||||
do
|
||||
{
|
||||
if (!IDEATAWaitNotBUSY(bd, timeout) || !IDEATANop(bd, timeout) || !IDEATAPIStartStop(bd, timeout, TRUE))
|
||||
return FALSE;
|
||||
if (InU8(bd->base0 + ATAR0_STAT) & ATAS_DRDY && !InU8(bd->base0 + ATAR0_FEAT));
|
||||
return TRUE;
|
||||
|
||||
IDEATAInit(bd);
|
||||
Yield;
|
||||
}
|
||||
while (!(0 < timeout < tS));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
U0 IDEATAReadBlks(CBlkDev *bd, U8 *buf, I64 blk, I64 count)
|
||||
{
|
||||
I64 retries = 3;
|
||||
Bool unlock = BlkDevLock(bd);
|
||||
|
||||
retry:
|
||||
IDEATABlkSel(bd, blk, count);
|
||||
if (bd->flags & BDF_EXT_SIZE)
|
||||
IDEATACmd(bd, ATA_READ_MULTI_EXT);
|
||||
else
|
||||
IDEATACmd(bd, ATA_READ_MULTI);
|
||||
|
||||
if (!IDEATAGetRes(bd, tS + 1.0, buf, count * bd->blk_size, BLK_SIZE, FALSE))
|
||||
{
|
||||
if (retries--)
|
||||
{
|
||||
IDEATAWaitNotBUSY(bd, 0);
|
||||
goto retry;
|
||||
}
|
||||
else
|
||||
throw('BlkDev');
|
||||
}
|
||||
|
||||
blkdev.read_count += (count * bd->blk_size) >> BLK_SIZE_BITS;
|
||||
|
||||
if (unlock)
|
||||
BlkDevUnlock(bd);
|
||||
}
|
||||
|
||||
I64 IDEATAProbe(I64 base0, I64 base1, I64 unit)
|
||||
{
|
||||
CBlkDev bd;
|
||||
|
@ -477,145 +393,6 @@ I64 IDEATAProbe(I64 base0, I64 base1, I64 unit)
|
|||
return IDEATAGetDevId(&bd, tS + 0.1, FALSE);
|
||||
}
|
||||
|
||||
Bool IDEATAPIReadBlks2(CBlkDev *bd, F64 timeout, U8 *buf, I64 native_blk, I64 count, Bool lock)
|
||||
{
|
||||
Bool res = FALSE, unlock;
|
||||
|
||||
if (count <= 0)
|
||||
return FALSE;
|
||||
if (lock)
|
||||
unlock = BlkDevLock(bd);
|
||||
if (IDEATAPIWaitReady(bd, timeout))
|
||||
{
|
||||
if (bd->flags & BDF_EXT_SIZE)
|
||||
OutU8(bd->base0 + ATAR0_SEL, 0xEF | bd->unit << 4);
|
||||
else
|
||||
OutU8(bd->base0 + ATAR0_SEL, 0xE0 | bd->unit << 4);
|
||||
|
||||
OutU8(bd->base0 + ATAR0_LCYL, bd->blk_size);
|
||||
OutU8(bd->base0 + ATAR0_HCYL, bd->blk_size.u8[1]);
|
||||
IDEATACmd(bd, ATA_PACKET);
|
||||
|
||||
if (IDEATAPIWritePacketWord(bd, timeout, ATAPI_READ, native_blk.u16[1], native_blk, count.u16[1], count, 0) &&
|
||||
IDEATAGetRes(bd, timeout, buf, count * bd->blk_size, 0, FALSE))
|
||||
{
|
||||
blkdev.read_count += (count * bd->blk_size) >> BLK_SIZE_BITS;
|
||||
res = TRUE;
|
||||
}
|
||||
}
|
||||
// IDEATAPIStartStop(bd, 0, FALSE);
|
||||
if (lock && unlock)
|
||||
BlkDevUnlock(bd);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 IDEATAPIReadBlks(CBlkDev *bd, U8 *buf, I64 blk, I64 count)
|
||||
{
|
||||
CDrive *drive = Letter2Drive(bd->first_drive_let);
|
||||
I64 retry, spc = bd->blk_size >> BLK_SIZE_BITS, n, blk2, l2 = bd->max_reads << 1 + spc << 1;
|
||||
U8 *dvd_buf = MAlloc(l2 << BLK_SIZE_BITS);
|
||||
|
||||
if (count > 0)
|
||||
{
|
||||
if (blk <= bd->max_reads)
|
||||
blk2 = 0;
|
||||
else
|
||||
blk2 = FloorU64(blk-bd->max_reads, spc);
|
||||
|
||||
if (blk2 + l2 > drive->size + drive->drv_offset)
|
||||
l2 = drive->size + drive->drv_offset - blk2;
|
||||
|
||||
n = (l2 + spc - 1) / spc;
|
||||
|
||||
retry = 4;
|
||||
while (--retry)
|
||||
if (IDEATAPIReadBlks2(bd, tS + 7.0 + 0.004 * n, dvd_buf, blk2 / spc, n, TRUE))
|
||||
//n is 0x800 if max_reads. Up to 8 additional seconds
|
||||
break;
|
||||
if (!retry)
|
||||
IDEATAPIReadBlks2(bd, 0, dvd_buf, blk2 / spc, n, TRUE);
|
||||
if (bd->flags & BDF_READ_CACHE)
|
||||
DiskCacheAdd(drive, dvd_buf, blk2, n * spc);
|
||||
|
||||
MemCopy(buf, dvd_buf + (blk - blk2) << BLK_SIZE_BITS, count << BLK_SIZE_BITS);
|
||||
}
|
||||
Free(dvd_buf);
|
||||
}
|
||||
|
||||
Bool IDEATARBlks(CDrive *drive, U8 *buf, I64 blk, I64 count)
|
||||
{
|
||||
I64 n;
|
||||
CBlkDev *bd = drive->bd;
|
||||
|
||||
while (count > 0)
|
||||
{
|
||||
n = count;
|
||||
if (n > bd->max_reads)
|
||||
n = bd->max_reads;
|
||||
|
||||
if (bd->type == BDT_ATAPI)
|
||||
IDEATAPIReadBlks(bd, buf, blk, n);
|
||||
else
|
||||
IDEATAReadBlks(bd, buf, blk, n);
|
||||
|
||||
buf += n << BLK_SIZE_BITS;
|
||||
blk += n;
|
||||
count -= n;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
U0 IDEATAWriteBlks(CBlkDev *bd, U8 *buf, I64 blk, I64 count)
|
||||
{//For low level disk access.
|
||||
//Use BlkWrite() instead.
|
||||
I64 i, U32s_avail, sects_avail, retries = 3;
|
||||
F64 timeout;
|
||||
Bool unlock = BlkDevLock(bd);
|
||||
|
||||
retry:
|
||||
IDEATABlkSel(bd, blk, count);
|
||||
if (bd->flags & BDF_EXT_SIZE)
|
||||
IDEATACmd(bd, ATA_WRITE_MULTI_EXT);
|
||||
else
|
||||
IDEATACmd(bd, ATA_WRITE_MULTI);
|
||||
|
||||
bd->flags |= BDF_LAST_WAS_WRITE;
|
||||
while (count > 0)
|
||||
{
|
||||
timeout = tS + 1.0;
|
||||
while (TRUE)
|
||||
{
|
||||
i = InU8(bd->base0 + ATAR0_STAT);
|
||||
if (!(i & ATAS_DRDY) || !(i & ATAS_DRQ))
|
||||
{
|
||||
Yield;
|
||||
}
|
||||
else
|
||||
break;
|
||||
if (/* i&ATAS_ERR||*/ tS > timeout)
|
||||
{
|
||||
if (retries--)
|
||||
{
|
||||
IDEATAWaitNotBUSY(bd, 0);
|
||||
goto retry;
|
||||
}
|
||||
else
|
||||
throw('BlkDev');
|
||||
}
|
||||
}
|
||||
sects_avail = 1;
|
||||
U32s_avail = sects_avail << BLK_SIZE_BITS >> 2;
|
||||
RepOutU32(buf, U32s_avail, bd->base0 + ATAR0_DATA);
|
||||
buf += U32s_avail << 2;
|
||||
count -= sects_avail;
|
||||
retries = 3;
|
||||
}
|
||||
IDEATAWaitNotBUSY(bd, 0);
|
||||
if (unlock)
|
||||
BlkDevUnlock(bd);
|
||||
}
|
||||
|
||||
Bool IDEATAPISync(CBlkDev *bd)
|
||||
{
|
||||
Bool okay = TRUE;
|
||||
|
@ -708,43 +485,3 @@ U0 IDEATAPIWriteBlks(CBlkDev *bd, U8 *buf, I64 native_blk, I64 count)
|
|||
}
|
||||
IDEATAWaitNotBUSY(bd, 0);
|
||||
}
|
||||
|
||||
Bool IDEATAWBlks(CDrive *drive, U8 *buf, I64 blk, I64 count)
|
||||
{
|
||||
I64 n, spc;
|
||||
CBlkDev *bd = drive->bd;
|
||||
Bool unlock;
|
||||
|
||||
spc = bd->blk_size >> BLK_SIZE_BITS;
|
||||
|
||||
if (bd->type == BDT_ATAPI)
|
||||
{
|
||||
unlock = BlkDevLock(bd);
|
||||
IDEATAPIWaitReady(bd, 0);
|
||||
}
|
||||
while (count > 0)
|
||||
{
|
||||
n = count;
|
||||
if (n > bd->max_writes)
|
||||
n = bd->max_writes;
|
||||
|
||||
if (bd->type == BDT_ATAPI)
|
||||
IDEATAPIWriteBlks(bd, buf, blk / spc, (n + spc - 1) / spc);
|
||||
else
|
||||
IDEATAWriteBlks(bd, buf, blk, n);
|
||||
|
||||
buf += n << BLK_SIZE_BITS;
|
||||
blk += n;
|
||||
count -= n;
|
||||
blkdev.write_count += n;
|
||||
}
|
||||
if (bd->type == BDT_ATAPI)
|
||||
{
|
||||
IDEATAPISync(bd);
|
||||
// IDEATAPIStartStop(bd,0,FALSE);
|
||||
if (unlock)
|
||||
BlkDevUnlock(bd);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -1,109 +1,3 @@
|
|||
Bool IDEBootDVDProbe(CBlkDev *bd)
|
||||
{
|
||||
U8 *img = CAlloc(DVD_BLK_SIZE);
|
||||
I64 i;
|
||||
Bool res = FALSE;
|
||||
|
||||
"Port: %04X,%04X Unit: %02X ", bd->base0, bd->base1, bd->unit;
|
||||
if (IDEATAProbe(bd->base0, bd->base1, bd->unit) == BDT_ATAPI)
|
||||
{
|
||||
" ATAPI";
|
||||
if (IDEATAPIStartStop(bd, tS + 5.0, TRUE))
|
||||
{
|
||||
" Started";
|
||||
for (i = 0; i < 2; i++)
|
||||
{//Retry
|
||||
if (IDEATAPIReadBlks2(bd, tS + 7.0, img, sys_boot_blk, 1, FALSE))
|
||||
{
|
||||
if ((img + sys_boot_src.u16[1] << BLK_SIZE_BITS)(CKernel *)->compile_time == sys_compile_time)
|
||||
{
|
||||
" Found\n";
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
" Read";
|
||||
}
|
||||
else
|
||||
" NoRead";
|
||||
}
|
||||
}
|
||||
}
|
||||
" Nope\n";
|
||||
Free(img);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
Bool IDEBootDVDProbeAll(CBlkDev *bd)
|
||||
{
|
||||
I64 d1, d2, i, j, k;
|
||||
|
||||
bd->base1 = 0;
|
||||
for (k = 0; k < 256; k++)
|
||||
{
|
||||
i = -1;
|
||||
while (TRUE)
|
||||
{
|
||||
j = PCIClassFind(0x010100 + k, ++i);
|
||||
if (j < 0)
|
||||
break;
|
||||
"Subcode:0x%X Bus:0x%X Dev:0x%X Fun:0x%X\n", k, j.u8[2], j.u8[1], j.u8[0];
|
||||
d1 = PCIReadU32(j.u8[2], j.u8[1], j.u8[0], 0x10);
|
||||
d2 = PCIReadU32(j.u8[2], j.u8[1], j.u8[0], 0x14);
|
||||
if (d1 & 1 && d2 & 1)
|
||||
{
|
||||
if (bd->base0 = d1 & ~7)
|
||||
{
|
||||
bd->unit = 0;
|
||||
if (IDEBootDVDProbe(bd))
|
||||
return TRUE;
|
||||
bd->unit = 1;
|
||||
if (IDEBootDVDProbe(bd))
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
d1 = PCIReadU32(j.u8[2], j.u8[1], j.u8[0], 0x18);
|
||||
d2 = PCIReadU32(j.u8[2], j.u8[1], j.u8[0], 0x1C);
|
||||
if (d1 & 1 && d2 & 1)
|
||||
{
|
||||
if (bd->base0 = d1 & ~7)
|
||||
{
|
||||
bd->unit = 0;
|
||||
if (IDEBootDVDProbe(bd))
|
||||
return TRUE;
|
||||
bd->unit = 1;
|
||||
if (IDEBootDVDProbe(bd))
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
d1 = 0x1F0;
|
||||
d2 = 0x3F6;
|
||||
if (bd->base0 = d1 & ~7)
|
||||
{
|
||||
bd->unit = 0;
|
||||
if (IDEBootDVDProbe(bd))
|
||||
return TRUE;
|
||||
bd->unit = 1;
|
||||
if (IDEBootDVDProbe(bd))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
d1 = 0x170;
|
||||
d2 = 0x376;
|
||||
if (bd->base0 = d1 & ~7)
|
||||
{
|
||||
bd->unit = 0;
|
||||
if (IDEBootDVDProbe(bd))
|
||||
return TRUE;
|
||||
bd->unit = 1;
|
||||
if (IDEBootDVDProbe(bd))
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
U0 ATARepEntry(I64 base0, I64 base1, I64 unit, U8 *message, CATARep **_head, I64 *num_hints)
|
||||
{
|
||||
I64 type;
|
||||
|
|
|
@ -83,16 +83,14 @@ I64 BlkDevAdd(CBlkDev *bd, I64 prt_num=I64_MIN, Bool whole_drive, Bool make_free
|
|||
drive->size = bd->max_blk + 1 - bd->drv_offset;
|
||||
//The following read is a test read.
|
||||
//if it hangs, the drive is not supported.
|
||||
// IDEATAReadBlks(bd, &mbr, 0, 1);
|
||||
AHCIAtaBlksRead(bd, &mbr, 0, 1); // ahci
|
||||
AHCIAtaBlksRead(bd, &mbr, 0, 1);
|
||||
break;
|
||||
}
|
||||
offset = 0;
|
||||
ext_base = INVALID_CLUS;
|
||||
while (prt_num < 0 || num <= prt_num)
|
||||
{
|
||||
// IDEATAReadBlks(bd, &mbr, offset, 1);
|
||||
AHCIAtaBlksRead(bd, &mbr, offset, 1); // ahci
|
||||
AHCIAtaBlksRead(bd, &mbr, offset, 1);
|
||||
if (mbr.signature != 0xAA55)
|
||||
break;
|
||||
j = -1;
|
||||
|
@ -123,8 +121,7 @@ I64 BlkDevAdd(CBlkDev *bd, I64 prt_num=I64_MIN, Bool whole_drive, Bool make_free
|
|||
case MBR_PT_FAT32d:
|
||||
case MBR_PT_FAT32e:
|
||||
case MBR_PT_FAT32f:
|
||||
// IDEATAReadBlks(bd, &br, drive->drv_offset, 1);
|
||||
AHCIAtaBlksRead(bd, &br, drive->drv_offset, 1); // ahci
|
||||
AHCIAtaBlksRead(bd, &br, drive->drv_offset, 1);
|
||||
|
||||
drive->drive_signature = DRIVE_SIGNATURE_VAL;
|
||||
drive->prt_num = num;
|
||||
|
@ -214,52 +211,6 @@ I64 SysI64Get()
|
|||
return Str2I64(st, 16);
|
||||
}
|
||||
|
||||
Bool GetBaseUnit(CBlkDev *bd)
|
||||
{
|
||||
I64 ch;
|
||||
Bool probe;
|
||||
|
||||
#exe {
|
||||
if (kernel_config->opts[CONFIG_DONT_PROBE])
|
||||
StreamPrint("probe = FALSE;");
|
||||
else
|
||||
StreamPrint("probe = TRUE;");
|
||||
};
|
||||
|
||||
if (!probe || !IDEBootDVDProbeAll(bd))
|
||||
{
|
||||
"\nDon't worry. This is not a product\n"
|
||||
"registration. ZealOS just needs the\n"
|
||||
"I/O port numbers for the CD/DVD.\n"
|
||||
"\nRetry the ports above or check Windows\n"
|
||||
"system information under I/O ports for\n"
|
||||
"'IDE', 'ATA' or 'SATA'.\n"
|
||||
"In Linux, use 'lspci -v' for ports.\n"
|
||||
"\n\nEnter 4-digit hex I/O Port number.\n"
|
||||
"CD/DVD I/O Port Base0: 0x";
|
||||
|
||||
bd->base0 = SysI64Get;
|
||||
bd->base1 = 0;
|
||||
bd->unit = 0;
|
||||
if (bd->base0)
|
||||
{
|
||||
"\nUnit (0 or 1): ";
|
||||
do ch = CharGet(, FALSE);
|
||||
while (!('0' <= ch <= '1'));
|
||||
'' ch;
|
||||
bd->unit = ch - '0';
|
||||
blkdev.dvd_boot_is_good = IDEBootDVDProbe(bd);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
blkdev.dvd_boot_is_good = FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
U0 BlkDevsInitAll()
|
||||
{
|
||||
CBlkDev *bd;
|
||||
|
|
|
@ -64,13 +64,10 @@ Bool BlkRead(CDrive *drive, U8 *buf, I64 blk, I64 count)
|
|||
break;
|
||||
|
||||
case BDT_ATA:
|
||||
// case BDT_ATAPI:
|
||||
// res = IDEATARBlks(drive, buf, blk, count);
|
||||
res = AHCIAtaRBlks(drive, buf, blk, count); // ahci
|
||||
res = AHCIAtaRBlks(drive, buf, blk, count);
|
||||
break;
|
||||
case BDT_ATAPI: // ahci
|
||||
case BDT_ATAPI:
|
||||
res = AHCIAtapiRBlks(drive, buf, blk, count);
|
||||
// D(buf, count);
|
||||
break;
|
||||
}
|
||||
bd->last_time = tS;
|
||||
|
@ -118,8 +115,7 @@ Bool BlkWrite(CDrive *drive, U8 *buf, I64 blk, I64 count)
|
|||
|
||||
case BDT_ATA:
|
||||
case BDT_ATAPI:
|
||||
// res = IDEATAWBlks(drive, buf, blk, count);
|
||||
res = AHCIAtaWBlks(drive, buf, blk, count); // ahci
|
||||
res = AHCIAtaWBlks(drive, buf, blk, count);
|
||||
break;
|
||||
}
|
||||
bd->last_time = tS;
|
||||
|
|
|
@ -110,8 +110,7 @@ Bool BlkDevInit(CBlkDev *bd)
|
|||
case BDT_ATA:
|
||||
bd->max_reads = 128;
|
||||
bd->max_writes = 1;
|
||||
// res = IDEATAInit(bd);
|
||||
res = AHCIAtaInit(bd); // ahci
|
||||
res = AHCIAtaInit(bd);
|
||||
break;
|
||||
|
||||
case BDT_ATAPI:
|
||||
|
@ -123,8 +122,7 @@ Bool BlkDevInit(CBlkDev *bd)
|
|||
if (bd->max_reads < 128)
|
||||
bd->max_reads = 128;
|
||||
bd->max_writes = 0xFFFF * 4;
|
||||
// if (res = IDEATAInit(bd))
|
||||
if (res = AHCIAtaInit(bd)) // ahci
|
||||
if (res = AHCIAtaInit(bd))
|
||||
drive->size = bd->max_blk + 1;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -103,14 +103,12 @@ U0 DVDImageRead(U8 dvd_drive_let, U8 *out_name)
|
|||
|
||||
retry = 4;
|
||||
while (--retry)
|
||||
// if (IDEATAPIReadBlks2(bd, tS + 7.0 + 0.004 * n / spc, buf, blk / spc, n / spc, TRUE))
|
||||
if (AHCIAtapiBlksRead(bd, buf, blk / spc, n / spc)) // ahci
|
||||
if (AHCIAtapiBlksRead(bd, buf, blk / spc, n / spc))
|
||||
//n is 0x800 if max_reads. Up to 8 additional seconds
|
||||
break;
|
||||
|
||||
if (!retry)
|
||||
// IDEATAPIReadBlks2(bd, 0, buf, blk / spc, n / spc, TRUE);
|
||||
AHCIAtapiBlksRead(bd, buf, blk / spc, n / spc); // ahci
|
||||
AHCIAtapiBlksRead(bd, buf, blk / spc, n / spc);
|
||||
|
||||
FBlkWrite(f, buf, blk, n);
|
||||
count -= n;
|
||||
|
@ -211,7 +209,7 @@ U0 DVDImageWrite(U8 dvd_drive_let, U8 *in_name=NULL, I64 media_type=MT_DVD)
|
|||
Yield;
|
||||
|
||||
BlkDevLock(bd);
|
||||
IDEATAPIWaitReady(bd, 0);
|
||||
// IDEATAPIWaitReady(bd, 0);
|
||||
|
||||
progress1 = 0;
|
||||
progress1_max = count;
|
||||
|
|
|
@ -276,8 +276,7 @@ U0 DiskChange(U8 drv_let=0)
|
|||
else if (bd->flags & BDF_REMOVABLE)
|
||||
{
|
||||
if (bd->type == BDT_ATAPI)
|
||||
//IDEATAInit(bd); //TODO: This is a kludge for QEMU?
|
||||
AHCIAtaInit(bd); //TODO: This is a kludge for QEMU? // ahci
|
||||
AHCIAtaInit(bd); //TODO: This is a kludge for QEMU?
|
||||
DiskCacheInvalidate(drive);
|
||||
}
|
||||
Drive(drv_let);
|
||||
|
|
|
@ -14,8 +14,7 @@ Bool DriveTypeSet(U8 drv_let, I64 type=FSt_REDSEA)
|
|||
ext_base = INVALID_CLUS;
|
||||
while (TRUE)
|
||||
{
|
||||
// IDEATAReadBlks(bd, &mbr, offset, 1);
|
||||
AHCIAtaBlksRead(bd, &mbr, offset, 1); // ahci
|
||||
AHCIAtaBlksRead(bd, &mbr, offset, 1);
|
||||
j =- 1;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
|
@ -42,8 +41,7 @@ Bool DriveTypeSet(U8 drv_let, I64 type=FSt_REDSEA)
|
|||
throw('Drive');
|
||||
}
|
||||
mbr.p[i].active = 0x80;
|
||||
// IDEATAWriteBlks(bd, &mbr, offset, 1);
|
||||
AHCIAtaBlksWrite(bd, &mbr, offset, 1); // ahci
|
||||
AHCIAtaBlksWrite(bd, &mbr, offset, 1);
|
||||
return TRUE;
|
||||
}
|
||||
drv_num++;
|
||||
|
|
|
@ -185,13 +185,13 @@ public U64 sys_font_std[256] = {
|
|||
0x6C6C6C7F00000000,//ˇ
|
||||
0x1818181F181F0000,//¸
|
||||
0x6C6C6C6F606F6C6C,//š
|
||||
0x6C6C6C6C6C6C6C6C,//ş
|
||||
0x6C6C6C6F607F0000,//ť
|
||||
0x0000007F606F6C6C,//ź
|
||||
0x3C3C3C3C3C3C3C3C,//º
|
||||
0x3C3C3C3F1F0F0000,//»
|
||||
0x0000000F1F3F3C3C,//¼
|
||||
0x0000007F6C6C6C6C,//˝
|
||||
0x0000001F181F1818,//ž
|
||||
0x1818181F00000000,//ż
|
||||
0x000000F818181818,//Ŕ
|
||||
0x1818180F00000000,//¿
|
||||
0x000000F018181818,//À
|
||||
0x000000FF18181818,//Á
|
||||
0x181818FF00000000,//Â
|
||||
0x181818F818181818,//Ă
|
||||
|
@ -199,12 +199,12 @@ public U64 sys_font_std[256] = {
|
|||
0x181818FF18181818,//Ĺ
|
||||
0x181818F818F81818,//Ć
|
||||
0x6C6C6CEC6C6C6C6C,//Ç
|
||||
0x000000FC0CEC6C6C,//Č
|
||||
0x6C6C6CEC0CFC0000,//É
|
||||
0x000000F0F8FC3C3C,//È
|
||||
0x3C3C3CFCF8F00000,//É
|
||||
0x000000FF00EF6C6C,//Ę
|
||||
0x6C6C6CEF00FF0000,//Ë
|
||||
0x6C6C6CEC0CEC6C6C,//Ě
|
||||
0x000000FF00FF0000,//Í
|
||||
0x000000FFFFFF0000,//Í
|
||||
0x6C6C6CEF00EF6C6C,//Î
|
||||
0x000000FF00FF1818,//Ď
|
||||
0x000000FF6C6C6C6C,//Đ
|
||||
|
@ -216,8 +216,8 @@ public U64 sys_font_std[256] = {
|
|||
0x6C6C6CFC00000000,//Ö
|
||||
0x6C6C6CEF6C6C6C6C,//×
|
||||
0x181818FF00FF1818,//Ř
|
||||
0x0000001F18181818,//Ů
|
||||
0x181818F800000000,//Ú
|
||||
0x0000000F18181818,//Ù
|
||||
0x181818F000000000,//Ú
|
||||
0xFFFFFFFFFFFFFFFF,//Ű
|
||||
0xFFFFFFFF00000000,//Ü
|
||||
0x0F0F0F0F0F0F0F0F,//Ý
|
||||
|
@ -254,5 +254,5 @@ public U64 sys_font_std[256] = {
|
|||
0x000000363636361E,//ü
|
||||
0x0000003E061C301E,//ý
|
||||
0x00003C3C3C3C0000,//ţ
|
||||
0xFFFFFFFFFFFFFFFF,//˙
|
||||
0xFFFFFFFFFFFFFFFF //ÿ
|
||||
};
|
|
@ -6,7 +6,7 @@ import U0 ClassRep(U8 *_d, U8 *class_name=lastclass, I64 max_depth=2, Bool u8_ch
|
|||
|
||||
import U8 *DocSave(CDoc *doc, I64 *_size=NULL);
|
||||
import Bool DocUnlock(CDoc *doc);
|
||||
import Bool Ed(U8 *link_st, I64 edf_dof_flags=0);
|
||||
import Bool Ed(U8 *link_st=NULL, I64 edf_dof_flags=0);
|
||||
|
||||
extern U0 SysErr(U8 *format, ...);
|
||||
extern U0 SysLog(U8 *format, ...);
|
||||
|
|
|
@ -13,7 +13,7 @@ CTask *sys_winmgr_task,
|
|||
U8 *rev_bits_table; //Table with U8 bits reversed
|
||||
CDate local_time_offset;
|
||||
F64 *pow10_I64,
|
||||
sys_os_version = 0.03;
|
||||
sys_os_version = 0.04;
|
||||
|
||||
CAutoCompleteDictGlobals acd;
|
||||
CAutoCompleteGlobals ac;
|
||||
|
|
|
@ -92,8 +92,14 @@ U0 SysGrInit()
|
|||
text.font = sys_font_std;
|
||||
|
||||
//patch some chars
|
||||
text.aux_font[10] = text.font[10]; //"Return" symbol
|
||||
text.aux_font[255] = text.font[255]; //Block symbol ÿ
|
||||
text.aux_font[10] = text.font[10]; //"Return" symbol
|
||||
text.aux_font[255] = text.font[255]; //Block symbol ÿ
|
||||
text.aux_font['º'] = text.font['º'];
|
||||
text.aux_font['»'] = text.font['»'];
|
||||
text.aux_font['¼'] = text.font['¼'];
|
||||
text.aux_font['È'] = text.font['È'];
|
||||
text.aux_font['É'] = text.font['É'];
|
||||
text.aux_font['Í'] = text.font['Í'];
|
||||
|
||||
text.border_chars[2] (I64) = 'ÄͳºÚÉ¿»';
|
||||
text.border_chars[10](U32) = 'ÀÈÙ¼';
|
||||
|
|
|
@ -353,8 +353,6 @@ public extern CATARep *ATAIDDrives(CATARep *head, CATARep **_ata_drive, CATARe
|
|||
extern CBlkDev *ATAMount(U8 first_drive_let, I64 type, I64 base0, I64 base1, I64 unit);
|
||||
extern Bool IDEATAPIStartStop(CBlkDev *bd, F64 timeout, Bool start);
|
||||
extern I64 IDEATAProbe(I64 base0, I64 base1, I64 unit);
|
||||
extern U0 IDEATAReadBlks( CBlkDev *bd, U8 *buf, I64 blk, I64 count);
|
||||
extern U0 IDEATAWriteBlks(CBlkDev *bd, U8 *buf, I64 blk, I64 count);
|
||||
extern I64 BlkDevAdd( CBlkDev *bd, I64 prt_num=I64_MIN, Bool whole_drive, Bool make_free);
|
||||
extern U0 DiskCacheInit(I64 size_in_U8s);
|
||||
public extern U0 DiskCacheInvalidate(CDrive *drive);
|
||||
|
|
|
@ -1,3 +1,90 @@
|
|||
CDirEntry OSFilesMGFind(CDirEntry *needle_entry, CDirEntry *haystack_list)
|
||||
{
|
||||
while (haystack_list)
|
||||
{
|
||||
if (!StrCompare(needle_entry->name, haystack_list->name))
|
||||
return haystack_list;
|
||||
haystack_list = haystack_list->next;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
U0 OSFilesMergeInner(CDirEntry *tmpde1, CDirEntry *tmpde2, I64 *_fuf_flags, I64 *_df_flags)
|
||||
{
|
||||
CDirEntry *tmpde;
|
||||
U8 *new;
|
||||
|
||||
while (tmpde1 && !(*_df_flags & DF_ABORT_ALL_FILES))
|
||||
{
|
||||
tmpde = OSFilesMGFind(tmpde1, tmpde2);
|
||||
if (!tmpde)
|
||||
{
|
||||
"$$BROWN$$Does Not Exist:%s$$FG$$\n", tmpde1->full_name;
|
||||
new = StrNew(tmpde1->full_name);
|
||||
new[0] = tmpde2->full_name[0]; // shortcut to quickly get drive letter
|
||||
Copy(tmpde1->full_name, new);
|
||||
Free(new);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (tmpde1->attr & RS_ATTR_DIR)
|
||||
OSFilesMergeInner(tmpde1->sub, tmpde->sub, _fuf_flags, _df_flags);
|
||||
else
|
||||
{
|
||||
if (AbsI64(tmpde1->datetime - tmpde->datetime) > CDATE_FREQ * 2) {//slop
|
||||
"%s", tmpde1->full_name;
|
||||
'\n';
|
||||
if (Bt(_fuf_flags, FUf_DIFF))
|
||||
{
|
||||
if (FilesFindMatch(tmpde1->full_name, FILEMASK_TXT))
|
||||
Diff(tmpde->full_name, tmpde1->full_name, _df_flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
tmpde1 = tmpde1->next;
|
||||
}
|
||||
}
|
||||
|
||||
U0 OSFilesMerge(U8 *dst_files_find_mask="/*", U8 *src_files_find_mask="/*", U8 *fu_flags=NULL)
|
||||
{ // See $LK+PU,"Merge",A="FF:::/System/Utils/Merge.CC,public U0 Merge"$.
|
||||
I64 df_flags = 0, fuf_flags = 0;
|
||||
CDirEntry *tmpde1 = NULL, *tmpde2 = NULL;
|
||||
|
||||
FlagsScan(&fuf_flags, Define("ST_FILE_UTIL_FLAGS"), "+r");
|
||||
FlagsScan(&fuf_flags, Define("ST_FILE_UTIL_FLAGS"), fu_flags);
|
||||
if (fuf_flags & ~(FUG_FILES_FIND | FUF_DIFF))
|
||||
throw('FUF');
|
||||
PrintWarn("This is based strictly on file dates.\n");
|
||||
tmpde1 = FilesFind(src_files_find_mask, fuf_flags & FUG_FILES_FIND);
|
||||
tmpde2 = FilesFind(dst_files_find_mask, fuf_flags & FUG_FILES_FIND);
|
||||
fuf_flags &= FUF_DIFF;
|
||||
OSFilesMergeInner(tmpde1, tmpde2, &fuf_flags, &df_flags);
|
||||
DirTreeDel(tmpde1);
|
||||
DirTreeDel(tmpde2);
|
||||
}
|
||||
|
||||
|
||||
U0 OSMerge(U8 dst_drv, U8 src_drv=':')
|
||||
{
|
||||
U8 *dst = MStrPrint("%C:/", dst_drv);
|
||||
U8 *src = MStrPrint("%C:/", src_drv);
|
||||
|
||||
CopyTree(src, "B:/");
|
||||
OSFilesMerge("B:/", dst, "+d");
|
||||
"Format %C:/ ? ", dst_drv;
|
||||
Format(dst_drv);
|
||||
CopyTree("B:/", dst);
|
||||
|
||||
BootHDIns(dst_drv);
|
||||
}
|
||||
|
||||
U0 OSUpgrade()
|
||||
{
|
||||
"\n\nTODO: OSUpgrade (base off OSInstall)\n\n";
|
||||
}
|
||||
|
||||
U0 InstallDrive(U8 drv_let)
|
||||
{
|
||||
U8 *st;
|
||||
|
@ -239,7 +326,7 @@ Bool DoInstall(Bool prompt_reboot)
|
|||
}
|
||||
else if (ch == 'U')
|
||||
{
|
||||
XTalk(Fs, "#include \"::/Misc/OSMerge\";;\n");
|
||||
OSUpgrade;
|
||||
prompt_reboot = FALSE;
|
||||
res = TRUE;
|
||||
}
|
||||
|
|
|
@ -41,7 +41,9 @@ U0 Tmp()
|
|||
break;
|
||||
case BOOT_SRC_HARDDRIVE:
|
||||
case BOOT_SRC_RAM:
|
||||
"$$PURPLE$$$$TX+CX,\"Tip of the Day\"$$$$FG$$\n";
|
||||
"$$PURPLE$$$$TX+CX,\"Tips of the Day\"$$$$FG$$\n";
|
||||
TipOfDay;Sleep((Now + counts.timer) & 0x7F);
|
||||
TipOfDay;Sleep((Now + counts.timer) & 0x7F);
|
||||
TipOfDay;
|
||||
// Type("::/Doc/Customize.DD");
|
||||
// if (FileFind("::/Misc/Tour"))
|
||||
|
|
|
@ -19,7 +19,7 @@ HashTablePurge(sys_task->hash_table);
|
|||
|
||||
//Debug("Type 'G;'");
|
||||
DocTermNew;
|
||||
WinVert(2, text.rows / 5);
|
||||
WinVert(2, text.rows / 8);
|
||||
|
||||
sys_winmgr_task = Spawn(&WinMgrTask, NULL, "Window Mgr");
|
||||
Fs->win_inhibit = WIG_TASK_DEFAULT - WIF_SELF_BORDER - WIF_SELF_GRAB_SCROLL - WIF_SELF_CTRLS;
|
||||
|
|
|
@ -130,8 +130,7 @@ drv_let=0 means add new drive that is not already mounted.
|
|||
mbr.p[i].size = remaining;
|
||||
ext_base = offset;
|
||||
}
|
||||
// IDEATAWriteBlks(bd, &mbr, 0, 1);
|
||||
AHCIAtaBlksWrite(bd, &mbr, 0, 1); // ahci
|
||||
AHCIAtaBlksWrite(bd, &mbr, 0, 1);
|
||||
|
||||
while (tmppp != &head)
|
||||
{
|
||||
|
@ -160,8 +159,7 @@ drv_let=0 means add new drive that is not already mounted.
|
|||
mbr.p[1].offset = offset - ext_base;
|
||||
mbr.p[1].size = tmppp->size;
|
||||
}
|
||||
// IDEATAWriteBlks(bd, &mbr, start_offset, 1);
|
||||
AHCIAtaBlksWrite(bd, &mbr, start_offset, 1); // ahci
|
||||
AHCIAtaBlksWrite(bd, &mbr, start_offset, 1);
|
||||
}
|
||||
|
||||
bd->flags &= ~(BDF_INITIALIZED | BDF_INIT_IN_PROGRESS);
|
||||
|
|
|
@ -89,10 +89,9 @@ I64 SATARep()
|
|||
#help_index "Install;File/Cmd Line (Typically);Cmd Line (Typically);"
|
||||
U8 Mount2(U8 boot_drive_let, CDoc *_doc, Bool _caller_is_prtdisk)
|
||||
{//If _doc, called by $LK,"::/Kernel/KConfig.CC"$ else called by $LK,"Mount",A="MN:Mount"$().
|
||||
I64 count, total = 0, num_hints, drv_let, type, unit, prt_num, port = -1; // ahci
|
||||
U8 blks_buf[STR_LEN], addr_buf[STR_LEN], base0_buf[STR_LEN],// base1_buf[STR_LEN],
|
||||
I64 count, total = 0, num_hints, drv_let, type, unit, prt_num, port = -1;
|
||||
U8 blks_buf[STR_LEN], addr_buf[STR_LEN], port_str[STR_LEN],
|
||||
*filename = NULL, *filename2 = NULL, res = 0;
|
||||
// CATARep *head = NULL, *tmpha;
|
||||
Bool whole_drive, make_free;
|
||||
CDoc *doc;
|
||||
|
||||
|
@ -146,57 +145,24 @@ U8 Mount2(U8 boot_drive_let, CDoc *_doc, Bool _caller_is_prtdisk)
|
|||
case BDT_ATA:
|
||||
prt_num = I64Get("Partition Num (Default=All):", prt_num);
|
||||
case BDT_ATAPI:
|
||||
// num_hints = ATARep(,, &head);
|
||||
num_hints = SATARep; // ahci
|
||||
num_hints = SATARep;
|
||||
if (type == BDT_ATAPI && boot_drive_let)
|
||||
"<ENTER> to use booted CD/DVD\n"; //Only $LK,"::/Kernel/KConfig.CC"$
|
||||
do
|
||||
{
|
||||
if (num_hints)
|
||||
"Enter port number: \n"; // ahci (!! using base0_buf for port num !!)
|
||||
// "Enter dev number or\nport with $$PURPLE$$0x$$FG$$ prefix.\n"
|
||||
// "I/O Port Base0:\n";
|
||||
// else
|
||||
// "Include $$PURPLE$$0x$$FG$$ prefix.\nI/O Port Base0:\n";
|
||||
StrNGet(base0_buf, STR_LEN);
|
||||
"Enter port number: \n";
|
||||
StrNGet(port_str, STR_LEN);
|
||||
}
|
||||
// while (!Str2I64(base0_buf) && (type != BDT_ATAPI || !boot_drive_let));
|
||||
while ((0 > Str2I64(base0_buf) || Str2I64(base0_buf) > num_hints - 1) &&
|
||||
(type != BDT_ATAPI || !boot_drive_let)); // ahci
|
||||
port = Str2I64(base0_buf);
|
||||
|
||||
/* if (1 <= Str2I64(base0_buf) <= num_hints)
|
||||
{
|
||||
tmpha = ATARepFind(head, Str2I64(base0_buf));
|
||||
StrPrint(base0_buf, "0x%X", tmpha->base0);
|
||||
StrPrint(base1_buf, "0x%X", tmpha->base1);
|
||||
unit = tmpha->unit;
|
||||
}
|
||||
else if (type != BDT_ATAPI || *base0_buf)
|
||||
{
|
||||
if (type == BDT_ATAPI)
|
||||
StrCopy(base1_buf, "0");
|
||||
else
|
||||
do
|
||||
{
|
||||
"I/O Port Base1:\n";
|
||||
StrNGet(base1_buf, STR_LEN);
|
||||
}
|
||||
while (!Str2I64(base1_buf));
|
||||
do
|
||||
{
|
||||
"\t$$PURPLE$$0$$FG$$=Master\n\t$$PURPLE$$1$$FG$$=Slave\nUnit:";
|
||||
unit = CharGet - '0';
|
||||
}
|
||||
while (!(0 <= unit <= 1));
|
||||
'\n';
|
||||
}
|
||||
LinkedListDel(head);*/
|
||||
while ((0 > Str2I64(port_str) || Str2I64(port_str) > num_hints - 1) &&
|
||||
(type != BDT_ATAPI || !boot_drive_let));
|
||||
|
||||
port = Str2I64(port_str);
|
||||
break;
|
||||
}
|
||||
DocPrint(doc, "\"bd = BlkDevNextFreeSlot('%C', %d); bd->unit = %d;\n\";\n", drv_let, type, unit);
|
||||
DocPrint(doc, "bd = BlkDevNextFreeSlot(\'%C\', %d); bd->unit = %d;\n", drv_let, type, unit);
|
||||
if (port != -1 && *base0_buf) // ahci
|
||||
if (port != -1 && *port_str)
|
||||
{
|
||||
DocPrint(doc, "\"AHCIPortInit(bd, &blkdev.ahci_hba->ports[%d], %d);\n\";\n", port, port);
|
||||
DocPrint(doc, "AHCIPortInit(bd, &blkdev.ahci_hba->ports[%d], %d);\n", port, port);
|
||||
|
@ -222,7 +188,7 @@ U8 Mount2(U8 boot_drive_let, CDoc *_doc, Bool _caller_is_prtdisk)
|
|||
|
||||
case BDT_ATA:
|
||||
case BDT_ATAPI:
|
||||
if (type == BDT_ATAPI && !*base0_buf && _doc)
|
||||
if (type == BDT_ATAPI && !*port_str && _doc)
|
||||
{
|
||||
DocPrint(doc, "\"AHCIBootDVDProbeAll(bd);\n\";\n");
|
||||
DocPrint(doc, "AHCIBootDVDProbeAll(bd);\n"); //Only $LK,"::/Kernel/KConfig.CC"$
|
||||
|
@ -230,8 +196,6 @@ U8 Mount2(U8 boot_drive_let, CDoc *_doc, Bool _caller_is_prtdisk)
|
|||
if (drv_let == boot_drive_let)
|
||||
make_free = TRUE;
|
||||
}
|
||||
// else
|
||||
// DocPrint(doc, "bd->base0 = %s; bd->base1 = %s;\n", base0_buf, base1_buf);
|
||||
if (type == BDT_ATA && _caller_is_prtdisk)
|
||||
{
|
||||
"\nReformat WHOLE drive!";
|
||||
|
|
|
@ -28,8 +28,7 @@ public U0 BootMHDOldRead(U8 src_drive, U8 dst_drive)
|
|||
{
|
||||
//Bypass partition bounds-checking
|
||||
BlkDevLock(bd);
|
||||
// IDEATAReadBlks(bd, &mbr, 0, 1);
|
||||
AHCIAtaBlksRead(bd, &mbr, 0, 1); // ahci
|
||||
AHCIAtaBlksRead(bd, &mbr, 0, 1);
|
||||
BlkDevUnlock(bd);
|
||||
|
||||
Drive(dst_drive);
|
||||
|
@ -50,8 +49,7 @@ public U0 BootMHDOldWrite(U8 src_drive, U8 dst_drive)
|
|||
{
|
||||
//Bypass partition bounds-checking
|
||||
BlkDevLock(bd);
|
||||
// IDEATAWriteBlks(bd, mbr, 0, 1);
|
||||
AHCIAtaBlksWrite(bd, mbr, 0, 1); // ahci
|
||||
AHCIAtaBlksWrite(bd, mbr, 0, 1);
|
||||
BlkDevUnlock(bd);
|
||||
}
|
||||
Free(mbr);
|
||||
|
@ -71,8 +69,7 @@ public U0 BootMHDZero(U8 dst_drive)
|
|||
MemSet(&mbr, 0, BLK_SIZE);
|
||||
//Bypass partition bounds-checking
|
||||
BlkDevLock(bd);
|
||||
// IDEATAWriteBlks(bd, &mbr, 0, 1);
|
||||
AHCIAtaBlksWrite(bd, &mbr, 0, 1); // ahci
|
||||
AHCIAtaBlksWrite(bd, &mbr, 0, 1);
|
||||
BlkDevUnlock(bd);
|
||||
}
|
||||
|
||||
|
@ -154,8 +151,7 @@ public Bool BootMHDIns(U8 drv_let, U8 *drv_list=NULL)
|
|||
*BMHD_DAP_BLK(I64 *) = Clus2Blk(drive, de.clus);
|
||||
//Bypass partition bounds-checking
|
||||
BlkDevLock(bd);
|
||||
// IDEATAReadBlks(bd, &mbr, 0, 1);
|
||||
AHCIAtaBlksRead(bd, &mbr, 0, 1); // ahci
|
||||
AHCIAtaBlksRead(bd, &mbr, 0, 1);
|
||||
|
||||
for (i = 0; i < BMHD_END - BMHD_CODE; i++)
|
||||
mbr.code[i] = BMHD_CODE(U8 *)[i];
|
||||
|
@ -171,8 +167,7 @@ public Bool BootMHDIns(U8 drv_let, U8 *drv_list=NULL)
|
|||
mbr.zero = 0;
|
||||
mbr.signature = 0xAA55;
|
||||
|
||||
// IDEATAWriteBlks(bd, &mbr, 0, 1);
|
||||
AHCIAtaBlksWrite(bd, &mbr, 0, 1); // ahci
|
||||
AHCIAtaBlksWrite(bd, &mbr, 0, 1);
|
||||
|
||||
BlkDevUnlock(bd);
|
||||
res = TRUE;
|
||||
|
|
|
@ -127,13 +127,16 @@ U0 DrawWinScroll(CDC *dc, CCtrl *c)
|
|||
dc->color = s->color >> 4;
|
||||
else
|
||||
dc->color = s->color & 0xF;
|
||||
GrRect(dc, c->left, c->top, c->right - c->left + 1, c->bottom - c->top + 1);
|
||||
// GrRect(dc, c->left, c->top, c->right - c->left + 1, c->bottom - c->top + 1);
|
||||
GrPutS(dc, c->left, c->top, "Û");
|
||||
|
||||
if (c->flags & CTRLF_CLICKED)
|
||||
dc->color = s->color & 0xF;
|
||||
else
|
||||
dc->color = s->color >> 4;
|
||||
GrRect(dc, c->left + 2, c->top + 2, c->right - c->left + 1 - 4, c->bottom - c->top + 1 - 4);
|
||||
// GrRect(dc, c->left + 2, c->top + 2, c->right - c->left + 1 - 4, c->bottom - c->top + 1 - 4);
|
||||
GrPutS(dc, c->left, c->top, "±");
|
||||
|
||||
}
|
||||
|
||||
U0 WinDerivedScrollValsUpdate(CCtrl *c)
|
||||
|
|
|
@ -118,8 +118,8 @@ public Bool DocEd(CDoc *doc, I64 dof_flags=0)
|
|||
bdoc = DocNew;
|
||||
bdoc->flags |= DOCF_BORDER_DOC;
|
||||
DocPrint(bdoc, "$$CM+TY+LX+NC,0,-1$$");
|
||||
DocPrint(bdoc, "$$TX+RX+BD,\"[X]\"$$");
|
||||
DocPrint(bdoc, "$$TX+LX+BD,\"MENU\"$$");
|
||||
DocPrint(bdoc, "$$BG,LTRED$$$$LTGRAY$$$$TX+RX+BD,\"[X]\"$$$$FG$$$$BG$$");
|
||||
DocPrint(bdoc, "$$BG,BROWN$$$$YELLOW$$$$TX+LX+BD,\"MENU\"$$$$FG$$$$BG$$");
|
||||
|
||||
old_task_title = StrNew(Fs->task_title);
|
||||
if (Fs->title_src != TTS_LOCKED_CONST)
|
||||
|
@ -225,13 +225,16 @@ public Bool DocEd(CDoc *doc, I64 dof_flags=0)
|
|||
}
|
||||
|
||||
#help_index "DolDoc/Cmd Line (Typically);Cmd Line (Typically)"
|
||||
public Bool Ed(U8 *link_st, I64 edf_dof_flags=0)
|
||||
public Bool Ed(U8 *link_st=NULL, I64 edf_dof_flags=0)
|
||||
{//Invoke document editor.
|
||||
U8 *filename, *needle_str;
|
||||
I64 i, num;
|
||||
Bool cont, res = FALSE;
|
||||
CDoc *doc;
|
||||
|
||||
if (!link_st)
|
||||
link_st = "";
|
||||
|
||||
switch (i = EdLinkConvert(link_st, &filename, &needle_str, &num, edf_dof_flags))
|
||||
{
|
||||
case -1:
|
||||
|
@ -289,7 +292,7 @@ public Bool Plain(U8 *filename, I64 edf_dof_flags=0)
|
|||
}
|
||||
|
||||
#help_index "DolDoc;Job/Exe;Task/Job/Exe"
|
||||
public I64 PopUpEd(U8 *filename, CTask *parent=NULL, CTask **_pu_task=NULL)
|
||||
public I64 PopUpEd(U8 *filename=NULL, CTask *parent=NULL, CTask **_pu_task=NULL)
|
||||
{//Create PopUp win task and edit a doc.
|
||||
U8 *st = MStrPrint("Ed(\"%Q\");", filename);
|
||||
I64 res = PopUp(st, parent, _pu_task);
|
||||
|
|
|
@ -31,8 +31,10 @@ public CDoc *DocBorderNew(CDoc *pdoc)
|
|||
doc_e->data = &Fs->task_title;
|
||||
DocDataFormat(bdoc, doc_e);
|
||||
DocPrint(bdoc, "$$CM+H+NC,1,0$$$$TX+H+BD+IV,\"%X\"$$", Fs);
|
||||
DocPrint(bdoc, "$$TX+H+RX+BD,\"[X]\"$$");
|
||||
DocPrint(bdoc, "$$TX+H+LX+BD,\"MENU\"$$");
|
||||
if (pdoc->win_task != sys_task)
|
||||
DocPrint(bdoc, "$$BG+H,LTRED$$$$LTGRAY+H$$$$TX+H+RX+BD,\"[X]\"$$$$BG+H$$$$FG+H$$");
|
||||
if (pdoc->win_task != sys_task && pdoc->win_task != ac.task)
|
||||
DocPrint(bdoc, "$$BG+H,BROWN$$$$YELLOW+H$$$$TX+H+LX+BD,\"MENU\"$$$$FG+H$$$$BG+H$$");
|
||||
|
||||
return bdoc;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ extern U0 DocTop(CDoc *doc=NULL);
|
|||
extern Bool DocUnlock(CDoc *doc);
|
||||
extern U0 DocUpdateTaskDocs(CTask *task);
|
||||
extern U0 DrawCtrls(CTask *task);
|
||||
extern Bool Ed(U8 *link_st, I64 edf_dof_flags=0);
|
||||
extern Bool Ed(U8 *link_st=NULL, I64 edf_dof_flags=0);
|
||||
extern U0 EdCodeTools(CDoc *doc);
|
||||
extern U8 *EdSprite(I64 bin_num);
|
||||
extern I64 ExeDoc(CDoc *doc, I64 ccf_flags=0);
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue