2021-07-03 05:07:57 +01:00
<!DOCTYPE HTML>
< html >
< head >
< meta http-equiv = "Content-Type" content = "text/html;charset=US-ASCII" >
2021-10-27 08:28:16 +01:00
< meta name = "generator" content = "ZealOS V1.04" >
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-26 20:29:49 +01:00
< a name = "l1" > < / a > < span class = cF2 > //See < / span > < a href = "https://zeal-operating-system.github.io/ZealOS/Doc/Install.DD.html#l1" > < span class = cF4 > Install Documentation< / span > < / a > < span class = cF2 > .< / span > < span class = cF0 >
< a name = "l2" > < / a > < / span > < span class = cF2 > //Study the account examples: < / span > < a href = "https://zeal-operating-system.github.io/ZealOS/Demo/AcctExample/TOS/TOSConfig.CC.html#l1" > < span class = cF4 > Config Strs< / span > < / a > < span class = cF2 > , < / span > < a href = "https://zeal-operating-system.github.io/ZealOS/Demo/AcctExample/TOS/TOSDistro.CC.html#l1" > < span class = cF4 > Update Funs< / span > < / a > < span class = cF0 >
2021-07-03 05:07:57 +01:00
< a name = "l3" > < / a >
< a name = "l4" > < / a > #< / span > < span class = cF1 > include< / span > < span class = cF0 > < / span > < span class = cF6 > " BootHD" < / span > < span class = cF0 >
< a name = "l5" > < / a >
< a name = "l6" > < / a > #< / span > < span class = cF1 > help_index< / span > < span class = cF0 > < / span > < span class = cF6 > " Install" < / span > < span class = cF0 >
< a name = "l7" > < / a >
2021-07-25 09:07:40 +01:00
< a name = "l8" > < / a > #< / span > < span class = cF1 > define< / span > < span class = cF0 > < / span > < span class = cF3 > KERNEL_BIN_C< / span > < span class = cF0 > < / span > < span class = cF6 > " Kernel.BIN.C" < / span > < span class = cF0 >
< a name = "l9" > < / a > #< / span > < span class = cF1 > define< / span > < span class = cF0 > < / span > < span class = cF3 > BOOT_DIR< / span > < span class = cF0 > < / span > < span class = cF6 > " /Boot" < / span > < span class = cF0 >
< a name = "l10" > < / a > #< / span > < span class = cF1 > define< / span > < span class = cF0 > < / span > < span class = cF3 > BOOT_DIR_KERNEL_BIN_C< / span > < span class = cF0 > < / span > < span class = cF3 > BOOT_DIR< / span > < span class = cF0 > < / span > < span class = cF6 > " /" < / span > < span class = cF0 > < / span > < span class = cF3 > KERNEL_BIN_C< / span > < span class = cF0 >
< a name = "l11" > < / a >
< a name = "l12" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cF5 > CompComp< / span > < span class = cF0 > ()
< a name = "l13" > < / a > {
< a name = "l14" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cF5 > Comp< / span > < span class = cF7 > (< / span > < span class = cF6 > " /Compiler/Compiler" < / span > < span class = cF0 > , < / span > < span class = cF6 > " Compiler" < / span > < span class = cF0 > ,, < / span > < span class = cF6 > ':'< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l15" > < / a > < / span > < span class = cF5 > throw< / span > < span class = cF0 > ;
< a name = "l16" > < / a > }
< a name = "l17" > < / a >
< a name = "l18" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cF5 > MakeAll< / span > < span class = cF0 > ()
< a name = "l19" > < / a > {
< a name = "l20" > < / a > < / span > < span class = cF5 > CompComp< / span > < span class = cF0 > ;
< a name = "l21" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cF5 > Comp< / span > < span class = cF7 > (< / span > < span class = cF6 > " /Kernel/Kernel" < / span > < span class = cF0 > , < / span > < span class = cF6 > " Kernel" < / span > < span class = cF0 > ,, < / span > < span class = cF6 > ':'< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l22" > < / a > < / span > < span class = cF5 > throw< / span > < span class = cF0 > ;
< a name = "l23" > < / a > }
< a name = "l24" > < / a >
< a name = "l25" > < / a > < / span > < span class = cF1 > public< / span > < span class = cF0 > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cF5 > BootHDIns< / span > < span class = cF0 > (< / span > < span class = cF1 > U8< / span > < span class = cF0 > drv_let=< / span > < span class = cFE > 0< / span > < span class = cF0 > )
2021-07-26 20:29:49 +01:00
< a name = "l26" > < / a > {< / span > < span class = cF2 > //< / span > < a href = "https://zeal-operating-system.github.io/ZealOS/System/Boot/BootHDIns.CC.html#l18" > < span class = cF4 > MakeAll< / span > < / a > < span class = cF2 > and install new boot-loader.< / span > < span class = cF0 >
2021-07-25 09:07:40 +01:00
< a name = "l27" > < / a > < / span > < span class = cF9 > CDrive< / span > < span class = cF0 > *drive;
< a name = "l28" > < / a > < / span > < span class = cF9 > CFAT32Boot< / span > < span class = cF0 > br;
< a name = "l29" > < / a > < / span > < span class = cF9 > CDirEntry< / span > < span class = cF0 > de;
< a name = "l30" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > i;
< a name = "l31" > < / a >
< a name = "l32" > < / a > < / span > < span class = cF1 > try< / span > < span class = cF0 >
< a name = "l33" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l34" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!< / span > < span class = cF5 > Drive< / span > < span class = cF7 > (< / span > < span class = cF0 > drv_let< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l35" > < / a > < / span > < span class = cF5 > throw< / span > < span class = cF0 > ;
< a name = "l36" > < / a >
< a name = "l37" > < / a > drive = < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> cur_dv;
< a name = "l38" > < / a > < / span > < span class = cF5 > MakeAll< / span > < span class = cF0 > ;
< a name = "l39" > < / a >
< a name = "l40" > < / a > < / span > < span class = cF1 > switch< / span > < span class = cF0 > (< / span > < span class = cF5 > Letter2BlkDevType< / span > < span class = cF7 > (< / span > < span class = cF0 > drive-> drv_let< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l41" > < / a > {
< a name = "l42" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > BDT_RAM< / span > < span class = cF0 > :
< a name = "l43" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > BDT_ATA< / span > < span class = cF0 > :
< a name = "l44" > < / a > < / span > < span class = cF5 > Move< / span > < span class = cF0 > (< / span > < span class = cF6 > " /Kernel/Kernel.BIN" < / span > < span class = cF0 > , < / span > < span class = cF3 > BOOT_DIR_KERNEL_BIN_C< / span > < span class = cF0 > );
< a name = "l45" > < / a >
< a name = "l46" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!< / span > < span class = cF5 > FileFind< / span > < span class = cF7 > (< / span > < span class = cF3 > BOOT_DIR_KERNEL_BIN_C< / span > < span class = cF0 > , & de, < / span > < span class = cF3 > FUF_JUST_FILES< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l47" > < / a > < / span > < span class = cF6 > " No Kernel.BIN.C\n" < / span > < span class = cF0 > ;
< a name = "l48" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l49" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l50" > < / a > < / span > < span class = cF5 > Free< / span > < span class = cF0 > (de.full_name);
< a name = "l51" > < / a > < / span > < span class = cF6 > " Modifying partition boot record.\n" < / span > < span class = cF0 > ;
< a name = "l52" > < / a > < / span > < span class = cF5 > BlkRead< / span > < span class = cF0 > (drive, & br, drive-> drv_offset, < / span > < span class = cFE > 1< / span > < span class = cF0 > );
< a name = "l53" > < / a >
< a name = "l54" > < / a > br.jump_and_nop[< / span > < span class = cFE > 0< / span > < span class = cF0 > ] = < / span > < span class = cF3 > OC_JMP_REL8< / span > < span class = cF0 > ;
< a name = "l55" > < / a > br.jump_and_nop[< / span > < span class = cFE > 1< / span > < span class = cF0 > ] = < / span > < span class = cF1 > offset< / span > < span class = cF0 > (< / span > < span class = cF9 > CFAT32Boot< / span > < span class = cF0 > .code) - < / span > < span class = cFE > 2< / span > < span class = cF0 > ;
< a name = "l56" > < / a >
< a name = "l57" > < / a > #< / span > < span class = cF1 > assert< / span > < span class = cF0 > < / span > < span class = cF1 > offset< / span > < span class = cF0 > (< / span > < span class = cF9 > CFAT32Boot< / span > < span class = cF0 > .code) > = < / span > < span class = cF1 > offset< / span > < span class = cF0 > (< / span > < span class = cF9 > CRedSeaBoot< / span > < span class = cF0 > .code)
< a name = "l58" > < / a >
< a name = "l59" > < / a > br.jump_and_nop[< / span > < span class = cFE > 2< / span > < span class = cF0 > ] = < / span > < span class = cF3 > OC_NOP< / span > < span class = cF0 > ;
< a name = "l60" > < / a > *< / span > < span class = cFD > BHD_BLK_COUNT< / span > < span class = cF0 > (< / span > < span class = cF9 > U16< / span > < span class = cF0 > *) = (de.size + < / span > < span class = cF3 > BLK_SIZE< / span > < span class = cF0 > - < / span > < span class = cFE > 1< / span > < span class = cF0 > ) > > < / span > < span class = cF3 > BLK_SIZE_BITS< / span > < span class = cF0 > ;
< a name = "l61" > < / a > *< / span > < span class = cFD > BHD_DAP_BLK< / span > < span class = cF0 > (< / span > < span class = cF9 > I64< / span > < span class = cF0 > *) = < / span > < span class = cF5 > Clus2Blk< / span > < span class = cF0 > (drive, de.clus);
< a name = "l62" > < / a >
< a name = "l63" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (i = < / span > < span class = cFE > 0< / span > < span class = cF0 > ; i < < / span > < span class = cFD > BHD_END< / span > < span class = cF0 > - < / span > < span class = cFD > BHD_CODE< / span > < span class = cF0 > ; i++)
< a name = "l64" > < / a > br.code[i] = < / span > < span class = cFD > BHD_CODE< / span > < span class = cF0 > (< / span > < span class = cF1 > U8< / span > < span class = cF0 > *)[i];
< a name = "l65" > < / a >
< a name = "l66" > < / a > #< / span > < span class = cF1 > assert< / span > < span class = cF0 > < / span > < span class = cF1 > sizeof< / span > < span class = cF0 > (< / span > < span class = cF9 > CFAT32Boot< / span > < span class = cF0 > .code) > = < / span > < span class = cFD > BHD_END< / span > < span class = cF0 > - < / span > < span class = cFD > BHD_CODE< / span > < span class = cF0 >
< a name = "l67" > < / a >
< a name = "l68" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (; i < < / span > < span class = cF1 > sizeof< / span > < span class = cF7 > (< / span > < span class = cF9 > CFAT32Boot< / span > < span class = cF0 > .code< / span > < span class = cF7 > )< / span > < span class = cF0 > ; i++)
< a name = "l69" > < / a > br.code[i] = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l70" > < / a >
< a name = "l71" > < / a > < / span > < span class = cF5 > BlkWrite< / span > < span class = cF0 > (drive, & br, drive-> drv_offset, < / span > < span class = cFE > 1< / span > < span class = cF0 > );
< a name = "l72" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l73" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
< a name = "l74" > < / a >
< a name = "l75" > < / a > < / span > < span class = cF1 > default< / span > < span class = cF0 > :
< a name = "l76" > < / a > < / span > < span class = cF5 > throw< / span > < span class = cF0 > ;
< a name = "l77" > < / a > }
< a name = "l78" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l79" > < / a > < / span > < span class = cF1 > catch< / span > < span class = cF0 >
< a name = "l80" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l81" > < / a > < / span > < span class = cF5 > PutExcept< / span > < span class = cF0 > ;
< a name = "l82" > < / a > < / span > < span class = cF5 > Beep< / span > < span class = cF0 > ;
< a name = "l83" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l84" > < / a > }
2021-07-03 05:07:57 +01:00
< / span > < / pre > < / body >
< / html >