2021-07-03 05:07:57 +01:00
<!DOCTYPE HTML>
< html >
< head >
< meta http-equiv = "Content-Type" content = "text/html;charset=US-ASCII" >
2021-12-11 11:10:58 +00:00
< meta name = "generator" content = "ZealOS V1.07" >
2021-07-03 05:07:57 +01:00
< style type = "text/css" >
2021-10-08 07:06:11 +01:00
body {background-color:#1f1f1f;}
.cF0{color:#e3e3e3;background-color:#1f1f1f;}
.cF1{color:#4f84a6;background-color:#1f1f1f;}
.cF2{color:#73a255;background-color:#1f1f1f;}
.cF3{color:#297582;background-color:#1f1f1f;}
.cF4{color:#b34f4b;background-color:#1f1f1f;}
.cF5{color:#8a52c3;background-color:#1f1f1f;}
.cF6{color:#b7822f;background-color:#1f1f1f;}
.cF7{color:#444444;background-color:#1f1f1f;}
.cF8{color:#6d6d6d;background-color:#1f1f1f;}
.cF9{color:#94bfde;background-color:#1f1f1f;}
.cFA{color:#a1ce97;background-color:#1f1f1f;}
.cFB{color:#6db4be;background-color:#1f1f1f;}
.cFC{color:#e88e88;background-color:#1f1f1f;}
.cFD{color:#ca94e8;background-color:#1f1f1f;}
.cFE{color:#d4b475;background-color:#1f1f1f;}
.cFF{color:#1f1f1f;background-color:#1f1f1f;}
2021-07-03 05:07:57 +01:00
< / style >
< / head >
< body >
2021-07-05 01:12:38 +01:00
< pre style = "font-family:monospace;font-size:12pt" >
2021-07-03 05:07:57 +01:00
< a name = "l1" > < / a > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cFD > BlkDevLockFwdingSet< / span > < span class = cF0 > (< / span > < span class = cF9 > CBlkDev< / span > < span class = cF0 > *bd)
< a name = "l2" > < / a > { < / span > < span class = cF2 > //If two blkdevs on same controller, use just one lock< / span > < span class = cF0 >
2021-07-04 23:11:34 +01:00
< a name = "l3" > < / a > < / span > < span class = cF9 > CBlkDev< / span > < span class = cF0 > *bd1;
< a name = "l4" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > i;
2021-07-03 05:07:57 +01:00
< a name = "l5" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l6" > < / a > < / span > < span class = cF1 > switch< / span > < span class = cF0 > (bd-> type)
< a name = "l7" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l8" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > BDT_RAM< / span > < span class = cF0 > :
< a name = "l9" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l10" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l11" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > BDT_ISO_FILE_READ< / span > < span class = cF0 > :
< a name = "l12" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > BDT_ISO_FILE_WRITE< / span > < span class = cF0 > :
< a name = "l13" > < / a > bd-> lock_fwding = < / span > < span class = cF5 > Letter2BlkDev< / span > < span class = cF0 > (*bd-> file_disk_name);
< a name = "l14" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l15" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l16" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > BDT_ATA< / span > < span class = cF0 > :
< a name = "l17" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > BDT_ATAPI< / span > < span class = cF0 > :
< a name = "l18" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (i = < / span > < span class = cFE > 0< / span > < span class = cF0 > ; i < < / span > < span class = cF3 > BLKDEVS_NUM< / span > < span class = cF0 > ; i++)
< a name = "l19" > < / a > {
< a name = "l20" > < / a > bd1 = & < / span > < span class = cFB > blkdev< / span > < span class = cF0 > .blkdevs[i];
< a name = "l21" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (bd1-> bd_signature == < / span > < span class = cF3 > BD_SIGNATURE_VAL< / span > < span class = cF0 > & & bd != bd1 & &
< a name = "l22" > < / a > < / span > < span class = cF7 > (< / span > < span class = cF0 > bd1-> type == < / span > < span class = cF3 > BDT_ATAPI< / span > < span class = cF0 > || bd1-> type == < / span > < span class = cF3 > BDT_ATA< / span > < span class = cF7 > )< / span > < span class = cF0 > & &
2021-12-04 10:03:02 +00:00
< a name = "l23" > < / a > bd1-> port_num == bd-> port_num)
2021-07-04 23:11:34 +01:00
< a name = "l24" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l25" > < / a > bd-> lock_fwding = bd1;
< a name = "l26" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
< a name = "l27" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l28" > < / a > }
< a name = "l29" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
< a name = "l30" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
2021-07-03 05:07:57 +01:00
< a name = "l31" > < / a > }
< a name = "l32" > < / a >
< a name = "l33" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > < / span > < span class = cF5 > BlkDevAdd< / span > < span class = cF0 > (< / span > < span class = cF9 > CBlkDev< / span > < span class = cF0 > *bd, < / span > < span class = cF9 > I64< / span > < span class = cF0 > prt_num=< / span > < span class = cF3 > I64_MIN< / span > < span class = cF0 > , < / span > < span class = cF1 > Bool< / span > < span class = cF0 > whole_drive, < / span > < span class = cF1 > Bool< / span > < span class = cF0 > make_free)
< a name = "l34" > < / a > {< / span > < span class = cF2 > //It will mount just one partition of prt_num> =0.< / span > < span class = cF0 >
< a name = "l35" > < / a > < / span > < span class = cF2 > //When repartitioing whole drive, whole_drive=TRUE.< / span > < span class = cF0 >
2021-07-04 23:11:34 +01:00
< a name = "l36" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > i, j, ext_base, < / span > < span class = cF1 > offset< / span > < span class = cF0 > , res = < / span > < span class = cFE > 0< / span > < span class = cF0 > , num = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l37" > < / a > < / span > < span class = cF9 > CDrive< / span > < span class = cF0 > *drive;
< a name = "l38" > < / a > < / span > < span class = cF9 > CRedSeaBoot< / span > < span class = cF0 > br;
< a name = "l39" > < / a > < / span > < span class = cF9 > CMasterBoot< / span > < span class = cF0 > mbr;
2021-07-03 05:07:57 +01:00
< a name = "l40" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l41" > < / a > bd-> bd_signature = < / span > < span class = cF3 > BD_SIGNATURE_VAL< / span > < span class = cF0 > ;
< a name = "l42" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (make_free)
< a name = "l43" > < / a > drive = < / span > < span class = cF5 > DriveMakeFreeSlot< / span > < span class = cF0 > (bd-> first_drive_let);
< a name = "l44" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l45" > < / a > drive = < / span > < span class = cF5 > DriveMakeFreeSlot< / span > < span class = cF0 > (< / span > < span class = cF5 > DriveNextFreeLet< / span > < span class = cF7 > (< / span > < span class = cF0 > bd-> first_drive_let< / span > < span class = cF7 > )< / span > < span class = cF0 > );
< a name = "l46" > < / a > drive-> bd = bd;
< a name = "l47" > < / a > drive-> drv_offset = bd-> drv_offset;
< a name = "l48" > < / a > drive-> size = bd-> max_blk + < / span > < span class = cFE > 1< / span > < span class = cF0 > - bd-> drv_offset;
< a name = "l49" > < / a > < / span > < span class = cF1 > switch< / span > < span class = cF0 > (bd-> type)
< a name = "l50" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l51" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > BDT_RAM< / span > < span class = cF0 > :
< a name = "l52" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > BDT_ISO_FILE_READ< / span > < span class = cF0 > :
< a name = "l53" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > BDT_ISO_FILE_WRITE< / span > < span class = cF0 > :
< a name = "l54" > < / a > drive-> drive_signature = < / span > < span class = cF3 > DRIVE_SIGNATURE_VAL< / span > < span class = cF0 > ;
< a name = "l55" > < / a > drive-> prt_num = num;
< a name = "l56" > < / a > drive-> fs_type = < / span > < span class = cF3 > FSt_REDSEA< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l57" > < / a > < / span > < span class = cF2 > //This is to force creation of a RAM< / span > < span class = cF0 >
2021-07-04 23:11:34 +01:00
< a name = "l58" > < / a > < / span > < span class = cF2 > //drive during boot, so it is probably< / span > < span class = cF0 >
Rename abs_addres to abs_address.
Update documentation/comments to rename addr, fun, var, stmt, blk, desc, reg, seg, ptr, dup, clus, val, and bttn, to address, function, variable, statement, block, description, register, segment, pointer, duplicate, cluster, value, and button, respectively.
2021-10-07 02:35:32 +01:00
< a name = "l59" > < / a > < / span > < span class = cF2 > //MAlloced to the same address and can< / span > < span class = cF0 >
2021-07-04 23:11:34 +01:00
< a name = "l60" > < / a > < / span > < span class = cF2 > //be assumed to be already formatted.< / span > < span class = cF0 >
< a name = "l61" > < / a > < / span > < span class = cF2 > //If this line is removed, RAM Drives< / span > < span class = cF0 >
< a name = "l62" > < / a > < / span > < span class = cF2 > //will be alloced on a just-in-time< / span > < span class = cF0 >
< a name = "l63" > < / a > < / span > < span class = cF2 > //basis.< / span > < span class = cF0 >
< a name = "l64" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cFD > BlkDevInit< / span > < span class = cF7 > (< / span > < span class = cF0 > bd< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l65" > < / a > res++;
< a name = "l66" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l67" > < / a > drive-> drive_signature = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l68" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l69" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l70" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > BDT_ATA< / span > < span class = cF0 > :
< a name = "l71" > < / a > drive-> drive_signature = < / span > < span class = cF3 > DRIVE_SIGNATURE_VAL< / span > < span class = cF0 > ; < / span > < span class = cF2 > //Temporarily validate< / span > < span class = cF0 >
< a name = "l72" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!< / span > < span class = cFD > BlkDevInit< / span > < span class = cF7 > (< / span > < span class = cF0 > bd< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l73" > < / a > drive-> drive_signature = < / span > < span class = cFE > 0< / span > < span class = cF0 > ; < / span > < span class = cF2 > //Revoke validation< / span > < span class = cF0 >
< a name = "l74" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l75" > < / a > {
< a name = "l76" > < / a > drive-> drive_signature = < / span > < span class = cFE > 0< / span > < span class = cF0 > ; < / span > < span class = cF2 > //Revoke validation< / span > < span class = cF0 >
< a name = "l77" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (whole_drive)
< a name = "l78" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l79" > < / a > drive-> drive_signature = < / span > < span class = cF3 > DRIVE_SIGNATURE_VAL< / span > < span class = cF0 > ;
< a name = "l80" > < / a > drive-> prt_num = num;
< a name = "l81" > < / a > res++;
< a name = "l82" > < / a > drive-> fs_type = < / span > < span class = cF3 > FSt_REDSEA< / span > < span class = cF0 > ;
< a name = "l83" > < / a > drive-> size = bd-> max_blk + < / span > < span class = cFE > 1< / span > < span class = cF0 > - bd-> drv_offset;
2021-07-03 05:07:57 +01:00
< a name = "l84" > < / a > < / span > < span class = cF2 > //The following read is a test read.< / span > < span class = cF0 >
2021-07-04 23:11:34 +01:00
< a name = "l85" > < / a > < / span > < span class = cF2 > //if it hangs, the drive is not supported.< / span > < span class = cF0 >
< a name = "l86" > < / a > < / span > < span class = cF5 > AHCIAtaBlksRead< / span > < span class = cF0 > (bd, & mbr, < / span > < span class = cFE > 0< / span > < span class = cF0 > , < / span > < span class = cFE > 1< / span > < span class = cF0 > );
< a name = "l87" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
< a name = "l88" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l89" > < / a > < / span > < span class = cF1 > offset< / span > < span class = cF0 > = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l90" > < / a > ext_base = < / span > < span class = cF3 > INVALID_CLUS< / span > < span class = cF0 > ;
< a name = "l91" > < / a > < / span > < span class = cF1 > while< / span > < span class = cF0 > (prt_num < < / span > < span class = cFE > 0< / span > < span class = cF0 > || num < = prt_num)
< a name = "l92" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l93" > < / a > < / span > < span class = cF5 > AHCIAtaBlksRead< / span > < span class = cF0 > (bd, & mbr, < / span > < span class = cF1 > offset< / span > < span class = cF0 > , < / span > < span class = cFE > 1< / span > < span class = cF0 > );
< a name = "l94" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (mbr.signature != < / span > < span class = cFE > 0xAA55< / span > < span class = cF0 > )
< a name = "l95" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
< a name = "l96" > < / a > j = -< / span > < span class = cFE > 1< / span > < span class = cF0 > ;
< a name = "l97" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (i = < / span > < span class = cFE > 0< / span > < span class = cF0 > ; i < < / span > < span class = cFE > 4< / span > < span class = cF0 > & & < / span > < span class = cF7 > (< / span > < span class = cF0 > prt_num < < / span > < span class = cFE > 0< / span > < span class = cF0 > || num < = prt_num< / span > < span class = cF7 > )< / span > < span class = cF0 > ; i++)
< a name = "l98" > < / a > {
< a name = "l99" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (mbr.p[i].type)
< a name = "l100" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l101" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (make_free)
< a name = "l102" > < / a > drive = < / span > < span class = cF5 > DriveMakeFreeSlot< / span > < span class = cF0 > (bd-> first_drive_let + res);
< a name = "l103" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l104" > < / a > drive = < / span > < span class = cF5 > DriveMakeFreeSlot< / span > < span class = cF0 > (< / span > < span class = cF5 > DriveNextFreeLet< / span > < span class = cF7 > (< / span > < span class = cF0 > bd-> first_drive_let + res< / span > < span class = cF7 > )< / span > < span class = cF0 > );
< a name = "l105" > < / a > drive-> bd = bd;
< a name = "l106" > < / a > drive-> drv_offset = mbr.p[i].< / span > < span class = cF1 > offset< / span > < span class = cF0 > + < / span > < span class = cF1 > offset< / span > < span class = cF0 > ;
< a name = "l107" > < / a > drive-> size = mbr.p[i].size;
< a name = "l108" > < / a > < / span > < span class = cF1 > switch< / span > < span class = cF0 > (mbr.p[i].type)
< a name = "l109" > < / a > {
< a name = "l110" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > MBR_PT_REDSEA< / span > < span class = cF0 > :
< a name = "l111" > < / a > drive-> drive_signature = < / span > < span class = cF3 > DRIVE_SIGNATURE_VAL< / span > < span class = cF0 > ;
< a name = "l112" > < / a > drive-> prt_num = num;
< a name = "l113" > < / a > res++;
< a name = "l114" > < / a > drive-> fs_type = < / span > < span class = cF3 > FSt_REDSEA< / span > < span class = cF0 > ;
< a name = "l115" > < / a > < / span > < span class = cFD > RedSeaInit< / span > < span class = cF0 > (drive);
< a name = "l116" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l117" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l118" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > MBR_PT_FAT32a< / span > < span class = cF0 > :
< a name = "l119" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > MBR_PT_FAT32b< / span > < span class = cF0 > :
< a name = "l120" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > MBR_PT_FAT32c< / span > < span class = cF0 > :
< a name = "l121" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > MBR_PT_FAT32d< / span > < span class = cF0 > :
< a name = "l122" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > MBR_PT_FAT32e< / span > < span class = cF0 > :
< a name = "l123" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > MBR_PT_FAT32f< / span > < span class = cF0 > :
< a name = "l124" > < / a > < / span > < span class = cF5 > AHCIAtaBlksRead< / span > < span class = cF0 > (bd, & br, drive-> drv_offset, < / span > < span class = cFE > 1< / span > < span class = cF0 > );
2021-07-03 05:07:57 +01:00
< a name = "l125" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l126" > < / a > drive-> drive_signature = < / span > < span class = cF3 > DRIVE_SIGNATURE_VAL< / span > < span class = cF0 > ;
< a name = "l127" > < / a > drive-> prt_num = num;
< a name = "l128" > < / a > res++;
< a name = "l129" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (br.signature == < / span > < span class = cF3 > MBR_PT_REDSEA< / span > < span class = cF0 > )
< a name = "l130" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l131" > < / a > drive-> fs_type = < / span > < span class = cF3 > FSt_REDSEA< / span > < span class = cF0 > ;
< a name = "l132" > < / a > < / span > < span class = cFD > RedSeaInit< / span > < span class = cF0 > (drive);
< a name = "l133" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l134" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l135" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l136" > < / a > drive-> fs_type = < / span > < span class = cF3 > FSt_FAT32< / span > < span class = cF0 > ;
< a name = "l137" > < / a > < / span > < span class = cFD > FAT32Init< / span > < span class = cF0 > (drive);
< a name = "l138" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l139" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l140" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l141" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > MBR_PT_NTFS< / span > < span class = cF0 > :
< a name = "l142" > < / a > drive-> drive_signature = < / span > < span class = cF3 > DRIVE_SIGNATURE_VAL< / span > < span class = cF0 > ;
< a name = "l143" > < / a > drive-> prt_num = num;
< a name = "l144" > < / a > res++;
< a name = "l145" > < / a > drive-> fs_type = < / span > < span class = cF3 > FSt_NTFS< / span > < span class = cF0 > ;
< a name = "l146" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l147" > < / a >
2021-08-23 08:14:22 +01:00
< a name = "l148" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > MBR_PT_LINUX< / span > < span class = cF0 > :
< a name = "l149" > < / a > drive-> drive_signature = < / span > < span class = cF3 > DRIVE_SIGNATURE_VAL< / span > < span class = cF0 > ;
< a name = "l150" > < / a > drive-> prt_num = num;
< a name = "l151" > < / a > res++;
< a name = "l152" > < / a > drive-> fs_type = < / span > < span class = cF3 > FSt_LINUX< / span > < span class = cF0 > ;
< a name = "l153" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
< a name = "l154" > < / a >
< a name = "l155" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > MBR_PT_SWAP< / span > < span class = cF0 > :
< a name = "l156" > < / a > drive-> drive_signature = < / span > < span class = cF3 > DRIVE_SIGNATURE_VAL< / span > < span class = cF0 > ;
< a name = "l157" > < / a > drive-> prt_num = num;
< a name = "l158" > < / a > res++;
< a name = "l159" > < / a > drive-> fs_type = < / span > < span class = cF3 > FSt_SWAP< / span > < span class = cF0 > ;
< a name = "l160" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
< a name = "l161" > < / a >
< a name = "l162" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cFE > 5< / span > < span class = cF0 > :
< a name = "l163" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cFE > 15< / span > < span class = cF0 > :
< a name = "l164" > < / a > j = i;
< a name = "l165" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
< a name = "l166" > < / a >
< a name = "l167" > < / a > < / span > < span class = cF1 > default< / span > < span class = cF0 > :
< a name = "l168" > < / a > drive-> drive_signature = < / span > < span class = cF3 > DRIVE_SIGNATURE_VAL< / span > < span class = cF0 > ;
< a name = "l169" > < / a > drive-> prt_num = num;
< a name = "l170" > < / a > res++;
< a name = "l171" > < / a > drive-> fs_type = < / span > < span class = cF3 > FSt_UNKNOWN< / span > < span class = cF0 > ;
< a name = "l172" > < / a > }
< a name = "l173" > < / a > num++;
< a name = "l174" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l175" > < / a > }
< a name = "l176" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cF5 > Letter2BlkDevType< / span > < span class = cF7 > (< / span > < span class = cF0 > bd-> first_drive_let + res< / span > < span class = cF7 > )< / span > < span class = cF0 > != bd-> type)
< a name = "l177" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
< a name = "l178" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (j < < / span > < span class = cFE > 0< / span > < span class = cF0 > )
< a name = "l179" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
< a name = "l180" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!mbr.p[j].< / span > < span class = cF1 > offset< / span > < span class = cF0 > )
< a name = "l181" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
< a name = "l182" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (ext_base == < / span > < span class = cF3 > INVALID_CLUS< / span > < span class = cF0 > )
< a name = "l183" > < / a > {
< a name = "l184" > < / a > < / span > < span class = cF1 > offset< / span > < span class = cF0 > = mbr.p[j].< / span > < span class = cF1 > offset< / span > < span class = cF0 > ;
< a name = "l185" > < / a > ext_base = < / span > < span class = cF1 > offset< / span > < span class = cF0 > ;
< a name = "l186" > < / a > }
< a name = "l187" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l188" > < / a > < / span > < span class = cF1 > offset< / span > < span class = cF0 > = mbr.p[j].< / span > < span class = cF1 > offset< / span > < span class = cF0 > + ext_base;
< a name = "l189" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l190" > < / a > }
< a name = "l191" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
< a name = "l192" > < / a >
< a name = "l193" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > BDT_ATAPI< / span > < span class = cF0 > :
< a name = "l194" > < / a > drive-> drive_signature = < / span > < span class = cF3 > DRIVE_SIGNATURE_VAL< / span > < span class = cF0 > ;
< a name = "l195" > < / a > drive-> prt_num = num;
< a name = "l196" > < / a > res++;
< a name = "l197" > < / a > drive-> fs_type = < / span > < span class = cF3 > FSt_ISO9660< / span > < span class = cF0 > ; < / span > < span class = cF2 > //Start with this< / span > < span class = cF0 >
< a name = "l198" > < / a > drive-> size = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l199" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
< a name = "l200" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l201" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (res)
< a name = "l202" > < / a > < / span > < span class = cFD > BlkDevLockFwdingSet< / span > < span class = cF0 > (bd);
< a name = "l203" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l204" > < / a > < / span > < span class = cF5 > BlkDevDel< / span > < span class = cF0 > (bd);
< a name = "l205" > < / a >
< a name = "l206" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > res;
< a name = "l207" > < / a > }
2021-07-03 05:07:57 +01:00
< a name = "l208" > < / a >
2021-08-23 08:14:22 +01:00
< a name = "l209" > < / a > < / span > < span class = cF1 > Bool< / span > < span class = cF0 > < / span > < span class = cF5 > DriveEnable< / span > < span class = cF0 > (< / span > < span class = cF1 > U8< / span > < span class = cF0 > drv_let, < / span > < span class = cF1 > Bool< / span > < span class = cF0 > val)
< a name = "l210" > < / a > {< / span > < span class = cF2 > //Can unmount or remount, but not mount the first time.< / span > < span class = cF0 >
< a name = "l211" > < / a > < / span > < span class = cF9 > CDrive< / span > < span class = cF0 > *drive;
< a name = "l212" > < / a >
< a name = "l213" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (drive = < / span > < span class = cF5 > Letter2Drive< / span > < span class = cF7 > (< / span > < span class = cF0 > drv_let, < / span > < span class = cF3 > FALSE< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l214" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > !< / span > < span class = cF5 > LBEqual< / span > < span class = cF0 > (& drive-> fs_type, < / span > < span class = cF3 > FStf_DISABLE< / span > < span class = cF0 > , !val);
< a name = "l215" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l216" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > < / span > < span class = cF3 > FALSE< / span > < span class = cF0 > ;
< a name = "l217" > < / a > }
2021-07-03 05:07:57 +01:00
< a name = "l218" > < / a >
2021-08-23 08:14:22 +01:00
< a name = "l219" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > < / span > < span class = cFD > SysI64Get< / span > < span class = cF0 > ()
< a name = "l220" > < / a > {
< a name = "l221" > < / a > < / span > < span class = cF1 > U8< / span > < span class = cF0 > st[< / span > < span class = cF3 > STR_LEN< / span > < span class = cF0 > ];
< a name = "l222" > < / a >
< a name = "l223" > < / a > < / span > < span class = cF5 > StrNGet< / span > < span class = cF0 > (st, < / span > < span class = cF3 > STR_LEN< / span > < span class = cF0 > , < / span > < span class = cF3 > FALSE< / span > < span class = cF0 > );
< a name = "l224" > < / a >
< a name = "l225" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > < / span > < span class = cF5 > Str2I64< / span > < span class = cF0 > (st, < / span > < span class = cFE > 16< / span > < span class = cF0 > );
< a name = "l226" > < / a > }
< a name = "l227" > < / a >
< a name = "l228" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cFD > BlkDevsInitAll< / span > < span class = cF0 > ()
< a name = "l229" > < / a > {
< a name = "l230" > < / a > < / span > < span class = cF9 > CBlkDev< / span > < span class = cF0 > *bd;
< a name = "l231" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > i;
< a name = "l232" > < / a >
< a name = "l233" > < / a > < / span > < span class = cFB > blkdev< / span > < span class = cF0 > .blkdevs = < / span > < span class = cF5 > CAlloc< / span > < span class = cF0 > (< / span > < span class = cF1 > sizeof< / span > < span class = cF7 > (< / span > < span class = cF9 > CBlkDev< / span > < span class = cF7 > )< / span > < span class = cF0 > * < / span > < span class = cF3 > BLKDEVS_NUM< / span > < span class = cF0 > );
< a name = "l234" > < / a > < / span > < span class = cFB > blkdev< / span > < span class = cF0 > .drvs = < / span > < span class = cF5 > CAlloc< / span > < span class = cF0 > (< / span > < span class = cF1 > sizeof< / span > < span class = cF7 > (< / span > < span class = cF9 > CDrive< / span > < span class = cF7 > )< / span > < span class = cF0 > * < / span > < span class = cF3 > DRIVES_NUM< / span > < span class = cF0 > );
< a name = "l235" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (i = < / span > < span class = cFE > 0< / span > < span class = cF0 > ; i < < / span > < span class = cF3 > DRIVES_NUM< / span > < span class = cF0 > ; i++)
< a name = "l236" > < / a > < / span > < span class = cFB > blkdev< / span > < span class = cF0 > .let_to_drive[i] = & < / span > < span class = cFB > blkdev< / span > < span class = cF0 > .drvs[i];
< a name = "l237" > < / a >
2021-10-08 07:06:11 +01:00
< a name = "l238" > < / a > < / span > < span class = cF6 > " \nAHCIInit;\n" < / span > < span class = cF0 > ;
< a name = "l239" > < / a > < / span > < span class = cFD > AHCIInit< / span > < span class = cF0 > ;
< a name = "l240" > < / a >
< a name = "l241" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!< / span > < span class = cFB > blkdev< / span > < span class = cF0 > .ahci_hba)
< a name = "l242" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l243" > < / a > < / span > < span class = cF6 > " \nZealOS requires AHCI.\n\n" < / span > < span class = cF0 >
< a name = "l244" > < / a > < / span > < span class = cF6 > " If in IDE compatibility mode, switch to SATA mode.\n" < / span > < span class = cF0 >
< a name = "l245" > < / a > < / span > < span class = cF6 > " If running in a VM, ensure disks are organized under a SATA controller.\n\n" < / span > < span class = cF0 >
< a name = "l246" > < / a > < / span > < span class = cF6 > " Rebooting in 10 seconds...\n" < / span > < span class = cF0 > ;
< a name = "l247" > < / a > < / span > < span class = cF5 > Sleep< / span > < span class = cF0 > (< / span > < span class = cFE > 10< / span > < span class = cF0 > *< / span > < span class = cFE > 1000< / span > < span class = cF0 > );
< a name = "l248" > < / a > < / span > < span class = cF5 > Reboot< / span > < span class = cF0 > ;
< a name = "l249" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l250" > < / a >
< a name = "l251" > < / a > #< / span > < span class = cF1 > exe< / span > < span class = cF0 > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l252" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (kernel_config-> opts[CONFIG_MOUNT_AHCI_AUTO])
< a name = "l253" > < / a > < / span > < span class = cF5 > StreamPrint< / span > < span class = cF0 > (< / span > < span class = cF6 > " MountAHCIAuto;" < / span > < span class = cF0 > );
< a name = "l254" > < / a > < / span > < span class = cF5 > StreamPrint< / span > < span class = cF0 > (< / span > < span class = cF6 > " #exe {Option(OPTf_WARN_PAREN, OFF);}" < / span > < span class = cF0 > );
< a name = "l255" > < / a > < / span > < span class = cF5 > StreamDoc< / span > < span class = cF0 > (kernel_config-> add_dev);
< a name = "l256" > < / a > < / span > < span class = cF5 > StreamPrint< / span > < span class = cF0 > (< / span > < span class = cF6 > " #exe {Option(OPTf_WARN_PAREN, ON);}" < / span > < span class = cF0 > );
< a name = "l257" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 > ;
< a name = "l258" > < / a > }
2021-07-03 05:07:57 +01:00
< / span > < / pre > < / body >
< / html >