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-03 05:07:57 +01:00
< a name = "l1" > < / a > < span class = cF0 > #< / span > < span class = cF1 > help_index< / span > < span class = cF0 > < / span > < span class = cF6 > " File/CD DVD" < / span > < span class = cF0 >
< a name = "l2" > < / a >
< a name = "l3" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cF5 > FillU16Palindrome< / span > < span class = cF0 > (< / span > < span class = cF9 > CPalindromeU16< / span > < span class = cF0 > *dst, < / span > < span class = cF9 > U16< / span > < span class = cF0 > w)
< a name = "l4" > < / a > {
2021-07-04 23:11:34 +01:00
< a name = "l5" > < / a > dst-> big = < / span > < span class = cF5 > EndianU16< / span > < span class = cF0 > (w);
< a name = "l6" > < / a > dst-> little = w;
2021-07-03 05:07:57 +01:00
< a name = "l7" > < / a > }
< a name = "l8" > < / a >
< a name = "l9" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cF5 > FillU32Palindrome< / span > < span class = cF0 > (< / span > < span class = cF9 > CPalindromeU32< / span > < span class = cF0 > *dst, < / span > < span class = cF9 > I64< / span > < span class = cF0 > d)
< a name = "l10" > < / a > {
2021-07-04 23:11:34 +01:00
< a name = "l11" > < / a > dst-> big = < / span > < span class = cF5 > EndianU32< / span > < span class = cF0 > (d);
< a name = "l12" > < / a > dst-> little = d;
2021-07-03 05:07:57 +01:00
< a name = "l13" > < / a > }
< a name = "l14" > < / a >
< a name = "l15" > < / a > < / span > < span class = cF1 > class< / span > < span class = cF0 > < / span > < span class = cF9 > CElTorito< / span > < span class = cF0 >
< a name = "l16" > < / a > {
2021-07-04 23:11:34 +01:00
< a name = "l17" > < / a > < / span > < span class = cF9 > U16< / span > < span class = cF0 > w[< / span > < span class = cFE > 16< / span > < span class = cF0 > ];
< a name = "l18" > < / a > < / span > < span class = cF1 > U8< / span > < span class = cF0 > bootable; < / span > < span class = cF2 > // 88=bootable 00=not bootable< / span > < span class = cF0 >
< a name = "l19" > < / a > < / span > < span class = cF1 > U8< / span > < span class = cF0 > media_type; < / span > < span class = cF2 > // 0=no emulation 4=hard disk< / span > < span class = cF0 >
< a name = "l20" > < / a > < / span > < span class = cF9 > U16< / span > < span class = cF0 > load_seg; < / span > < span class = cF2 > // 0000-> 07C0< / span > < span class = cF0 >
< a name = "l21" > < / a > < / span > < span class = cF1 > U8< / span > < span class = cF0 > sys_type;
< a name = "l22" > < / a > < / span > < span class = cF1 > U8< / span > < span class = cF0 > zero;
< a name = "l23" > < / a > < / span > < span class = cF9 > U16< / span > < span class = cF0 > sect_count;
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 = "l24" > < / a > < / span > < span class = cF9 > U32< / span > < span class = cF0 > load_rba; < / span > < span class = cF2 > // start address of virtual disk< / span > < span class = cF0 >
2021-07-04 23:11:34 +01:00
< a name = "l25" > < / a > < / span > < span class = cF1 > U8< / span > < span class = cF0 > zero2[< / span > < span class = cFE > 20< / span > < span class = cF0 > ];
2021-07-03 05:07:57 +01:00
< a name = "l26" > < / a > };
< a name = "l27" > < / a >
< a name = "l28" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cF5 > RedSeaISO9660Stage1< / span > < span class = cF0 > (< / span > < span class = cF1 > U8< / span > < span class = cF0 > *iso_filename, < / span > < span class = cF1 > U8< / span > < span class = cF0 > *stage2_filename)
< a name = "l29" > < / a > {
2021-07-04 23:11:34 +01:00
< a name = "l30" > < / a > < / span > < span class = cF9 > CDirEntry< / span > < span class = cF0 > de;
< a name = "l31" > < / a > < / span > < span class = cF9 > CFile< / span > < span class = cF0 > *out_file = < / span > < span class = cF3 > NULL< / span > < span class = cF0 > ;
< a name = "l32" > < / a > < / span > < span class = cF1 > U8< / span > < span class = cF0 > *stage1_buf = < / span > < span class = cF5 > CAlloc< / span > < span class = cF0 > (< / span > < span class = cF3 > DVD_BOOT_LOADER_SIZE< / span > < span class = cF0 > );
2021-07-03 05:07:57 +01:00
< a name = "l33" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l34" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cF5 > FileFind< / span > < span class = cF7 > (< / span > < span class = cF0 > stage2_filename, & de< / span > < span class = cF7 > )< / span > < span class = cF0 > & & < / span > < span class = cF7 > (< / span > < span class = cF0 > out_file = < / span > < span class = cF5 > FOpen< / span > < span class = cF0 > (iso_filename, < / span > < span class = cF6 > " wc+" < / span > < span class = cF0 > )< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l35" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l36" > < / a > < / span > < span class = cF5 > MemCopy< / span > < span class = cF0 > (stage1_buf, < / span > < span class = cFD > BDVD_START< / span > < span class = cF0 > , < / span > < span class = cFD > BDVD_END< / span > < span class = cF0 > - < / span > < span class = cFD > BDVD_START< / span > < span class = cF0 > );
< a name = "l37" > < / a > *(< / span > < span class = cFD > BDVD_BLK_LO< / span > < span class = cF0 > - < / span > < span class = cFD > BDVD_START< / span > < span class = cF0 > + stage1_buf)(< / span > < span class = cF9 > U32< / span > < span class = cF0 > *) = de.clus > > < / span > < span class = cFE > 2< / span > < span class = cF0 > ;
< a name = "l38" > < / a > *(< / span > < span class = cFD > BDVD_BLK_COUNT< / span > < span class = cF0 > - < / span > < span class = cFD > BDVD_START< / span > < span class = cF0 > + stage1_buf)(< / span > < span class = cF9 > U16< / span > < span class = cF0 > *) = (de.size + < / span > < span class = cF3 > DVD_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 > + < / span > < span class = cFE > 2< / span > < span class = cF0 > );
< a name = "l39" > < / a > *(< / span > < span class = cFD > BDVD_SHIFT_BLKS< / span > < span class = cF0 > - < / span > < span class = cFD > BDVD_START< / span > < span class = cF0 > + stage1_buf)(< / span > < span class = cF9 > U16< / span > < span class = cF0 > *) = de.clus & < / span > < span class = cFE > 3< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l40" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l41" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (de.clus & < / span > < span class = cFE > 3< / span > < span class = cF0 > )
< a name = "l42" > < / a > *(< / span > < span class = cFD > BDVD_BLK_COUNT< / span > < span class = cF0 > - < / span > < span class = cFD > BDVD_START< / span > < span class = cF0 > + stage1_buf)(< / span > < span class = cF9 > U16< / span > < span class = cF0 > *) += < / span > < span class = cFE > 1< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l43" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l44" > < / a > < / span > < span class = cF5 > FBlkWrite< / span > < span class = cF0 > (out_file, stage1_buf, < / span > < span class = cFE > 20< / span > < span class = cF0 > < < < / span > < span class = cFE > 2< / span > < span class = cF0 > + < / span > < span class = cFE > 1< / span > < span class = cF0 > < < < / span > < span class = cFE > 2< / span > < span class = cF0 > , < / span > < span class = cF3 > DVD_BOOT_LOADER_SIZE< / span > < span class = cF0 > / < / span > < span class = cF3 > BLK_SIZE< / span > < span class = cF0 > );
< a name = "l45" > < / a > < / span > < span class = cF5 > FClose< / span > < span class = cF0 > (out_file);
< a name = "l46" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l47" > < / a > < / span > < span class = cF5 > Free< / span > < span class = cF0 > (stage1_buf);
2021-07-03 05:07:57 +01:00
< a name = "l48" > < / a > }
< a name = "l49" > < / a >
< a name = "l50" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cF5 > RedSeaISO9660< / span > < span class = cF0 > (< / span > < span class = cF1 > U8< / span > < span class = cF0 > *iso_filename, < / span > < span class = cF1 > U8< / span > < span class = cF0 > drv_let)
< a name = "l51" > < / a > {
2021-07-04 23:11:34 +01:00
< a name = "l52" > < / a > < / span > < span class = cF9 > CDrive< / span > < span class = cF0 > *drive = < / span > < span class = cF5 > Letter2Drive< / span > < span class = cF0 > (drv_let);
< a name = "l53" > < / a > < / span > < span class = cF9 > CISOPriDesc< / span > < span class = cF0 > *iso_pri = < / span > < span class = cF5 > CAlloc< / span > < span class = cF0 > (< / span > < span class = cF3 > DVD_BLK_SIZE< / span > < span class = cF0 > ),
< a name = "l54" > < / a > *iso_boot = < / span > < span class = cF5 > CAlloc< / span > < span class = cF0 > (< / span > < span class = cF3 > DVD_BLK_SIZE< / span > < span class = cF0 > ),
< a name = "l55" > < / a > *iso_sup = < / span > < span class = cF5 > CAlloc< / span > < span class = cF0 > (< / span > < span class = cF3 > DVD_BLK_SIZE< / span > < span class = cF0 > ),
< a name = "l56" > < / a > *iso_term = < / span > < span class = cF5 > CAlloc< / span > < span class = cF0 > (< / span > < span class = cF3 > DVD_BLK_SIZE< / span > < span class = cF0 > );
< a name = "l57" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > iso_size = < / span > < span class = cFE > 0< / span > < span class = cF0 > , i, j;
< a name = "l58" > < / a > < / span > < span class = cF9 > U32< / span > < span class = cF0 > *d;
< a name = "l59" > < / a > < / span > < span class = cF9 > CElTorito< / span > < span class = cF0 > *et = < / span > < span class = cF5 > CAlloc< / span > < span class = cF0 > (< / span > < span class = cF3 > DVD_BLK_SIZE< / span > < span class = cF0 > );
2021-08-13 23:46:15 +01:00
< a name = "l60" > < / a > < / span > < span class = cF1 > U8< / span > < span class = cF0 > *zero_buf = < / span > < span class = cF5 > CAlloc< / span > < span class = cF0 > (< / span > < span class = cF3 > DVD_BLK_SIZE< / span > < span class = cF0 > ), *st;
2021-07-04 23:11:34 +01:00
< a name = "l61" > < / a > < / span > < span class = cF9 > CFile< / span > < span class = cF0 > *out_file = < / span > < span class = cF3 > NULL< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l62" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l63" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (out_file = < / span > < span class = cF5 > FOpen< / span > < span class = cF7 > (< / span > < span class = cF0 > iso_filename, < / span > < span class = cF6 > " wc+" < / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l64" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l65" > < / a > iso_size = < / span > < span class = cF5 > FSize< / span > < span class = cF0 > (out_file) / < / span > < span class = cF3 > DVD_BLK_SIZE< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l66" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l67" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (i = < / span > < span class = cFE > 0< / span > < span class = cF0 > ; i < drive-> bd-> drv_offset; i += < / span > < span class = cFE > 4< / span > < span class = cF0 > )
< a name = "l68" > < / a > < / span > < span class = cF5 > FBlkWrite< / span > < span class = cF0 > (out_file, zero_buf, i, < / span > < span class = cFE > 4< / 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 > iso_pri-> type = < / span > < span class = cF3 > ISOT_PRI_VOL_DESC< / span > < span class = cF0 > ;
< a name = "l71" > < / a > < / span > < span class = cF5 > StrCopy< / span > < span class = cF0 > (iso_pri-> id, < / span > < span class = cF6 > " CD001" < / span > < span class = cF0 > );
< a name = "l72" > < / a > iso_pri-> version = < / span > < span class = cFE > 1< / span > < span class = cF0 > ;
< a name = "l73" > < / a > < / span > < span class = cF5 > FillU16Palindrome< / span > < span class = cF0 > (& iso_pri-> vol_set_size, < / span > < span class = cFE > 1< / span > < span class = cF0 > );
< a name = "l74" > < / a > < / span > < span class = cF5 > FillU16Palindrome< / span > < span class = cF0 > (& iso_pri-> vol_seq_num, < / span > < span class = cFE > 1< / span > < span class = cF0 > );
< a name = "l75" > < / a > < / span > < span class = cF5 > FillU16Palindrome< / span > < span class = cF0 > (& iso_pri-> log_block_size, < / span > < span class = cF3 > DVD_BLK_SIZE< / span > < span class = cF0 > );
< a name = "l76" > < / a > < / span > < span class = cF5 > FillU32Palindrome< / span > < span class = cF0 > (& iso_pri-> vol_space_size, iso_size);
< a name = "l77" > < / a > < / span > < span class = cF5 > FillU32Palindrome< / span > < span class = cF0 > (& iso_pri-> root_dir_record, drive-> root_clus);
< a name = "l78" > < / a > iso_pri-> file_structure_version = < / span > < span class = cFE > 1< / span > < span class = cF0 > ;
< a name = "l79" > < / a > < / span > < span class = cF5 > StrCopy< / span > < span class = cF0 > (iso_pri-> publisher_id, < / span > < span class = cF6 > " ZealOS RedSea" < / span > < span class = cF0 > );
2021-07-03 05:07:57 +01:00
< a name = "l80" > < / a >
2021-08-13 23:46:15 +01:00
< a name = "l81" > < / a > st = < / span > < span class = cF5 > MStrPrint< / span > < span class = cF0 > (< / span > < span class = cF6 > " ZealOS V%0.2f %D %T" < / span > < span class = cF0 > , < / span > < span class = cFB > sys_os_version< / span > < span class = cF0 > , < / span > < span class = cF5 > Now< / span > < span class = cF0 > , < / span > < span class = cF5 > Now< / span > < span class = cF0 > );
< a name = "l82" > < / a > < / span > < span class = cF5 > StrCopy< / span > < span class = cF0 > (iso_pri-> preparer_id, st);
< a name = "l83" > < / a > < / span > < span class = cF5 > Free< / span > < span class = cF0 > (st);
< a name = "l84" > < / a >
< a name = "l85" > < / a > < / span > < span class = cF5 > MemCopy< / span > < span class = cF0 > (iso_sup, iso_pri, < / span > < span class = cF3 > DVD_BLK_SIZE< / span > < span class = cF0 > );
< a name = "l86" > < / a > iso_sup-> type = < / span > < span class = cF3 > ISOT_SUPPLEMENTARY_DESC< / span > < span class = cF0 > ;
< a name = "l87" > < / a >
< a name = "l88" > < / a > iso_boot-> type = < / span > < span class = cF3 > ISOT_BOOT_RECORD< / span > < span class = cF0 > ;
< a name = "l89" > < / a > < / span > < span class = cF5 > StrCopy< / span > < span class = cF0 > (iso_boot-> id, < / span > < span class = cF6 > " CD001" < / span > < span class = cF0 > );
< a name = "l90" > < / a > iso_boot-> version = < / span > < span class = cFE > 1< / span > < span class = cF0 > ;
< a name = "l91" > < / a > < / span > < span class = cF5 > StrCopy< / span > < span class = cF0 > (iso_boot< / span > < span class = cF7 > (< / span > < span class = cF1 > U8< / span > < span class = cF0 > *< / span > < span class = cF7 > )< / span > < span class = cF0 > + < / span > < span class = cFE > 7< / span > < span class = cF0 > , < / span > < span class = cF6 > " EL TORITO SPECIFICATION" < / span > < span class = cF0 > );
< a name = "l92" > < / a >
< a name = "l93" > < / a > < / span > < span class = cF5 > FBlkWrite< / span > < span class = cF0 > (out_file, iso_pri, < / span > < span class = cFE > 16< / span > < span class = cF0 > < < < / span > < span class = cFE > 2< / span > < span class = cF0 > , < / span > < span class = cFE > 4< / span > < span class = cF0 > );
< a name = "l94" > < / a > iso_term-> type = < / span > < span class = cF3 > ISOT_TERMINATOR< / span > < span class = cF0 > ;
< a name = "l95" > < / a > < / span > < span class = cF5 > StrCopy< / span > < span class = cF0 > (iso_term-> id, < / span > < span class = cF6 > " CD001" < / span > < span class = cF0 > );
< a name = "l96" > < / a > iso_term-> version = < / span > < span class = cFE > 1< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l97" > < / a >
2021-08-13 23:46:15 +01:00
< a name = "l98" > < / a > d = iso_boot(< / span > < span class = cF1 > U8< / span > < span class = cF0 > *) + < / span > < span class = cFE > 0x47< / span > < span class = cF0 > ;
< a name = "l99" > < / a > *d = < / span > < span class = cFE > 20< / span > < span class = cF0 > < < < / span > < span class = cFE > 2< / span > < span class = cF0 > > > < / span > < span class = cFE > 2< / span > < span class = cF0 > ;
< a name = "l100" > < / a > < / span > < span class = cF5 > FBlkWrite< / span > < span class = cF0 > (out_file, iso_boot, < / span > < span class = cFE > 17< / span > < span class = cF0 > < < < / span > < span class = cFE > 2< / span > < span class = cF0 > , < / span > < span class = cFE > 4< / span > < span class = cF0 > );
< a name = "l101" > < / a >
< a name = "l102" > < / a > < / span > < span class = cF5 > FBlkWrite< / span > < span class = cF0 > (out_file, iso_sup, < / span > < span class = cFE > 18< / span > < span class = cF0 > < < < / span > < span class = cFE > 2< / span > < span class = cF0 > , < / span > < span class = cFE > 4< / span > < span class = cF0 > );
< a name = "l103" > < / a > < / span > < span class = cF5 > FBlkWrite< / span > < span class = cF0 > (out_file, iso_term, < / span > < span class = cFE > 19< / span > < span class = cF0 > < < < / span > < span class = cFE > 2< / span > < span class = cF0 > , < / span > < span class = cFE > 4< / span > < span class = cF0 > );
2021-07-03 05:07:57 +01:00
< a name = "l104" > < / a >
2021-08-13 23:46:15 +01:00
< a name = "l105" > < / a > et-> w[< / span > < span class = cFE > 0< / span > < span class = cF0 > ] = < / span > < span class = cFE > 1< / span > < span class = cF0 > ;
< a name = "l106" > < / a > < / span > < span class = cF5 > StrCopy< / span > < span class = cF0 > (& et-> w[< / span > < span class = cFE > 2< / span > < span class = cF0 > ], < / span > < span class = cF6 > " ZealOS" < / span > < span class = cF0 > );
< a name = "l107" > < / a > et-> w[< / span > < span class = cFE > 15< / span > < span class = cF0 > ] = < / span > < span class = cFE > 0xAA55< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l108" > < / a >
2021-08-13 23:46:15 +01:00
< a name = "l109" > < / a > j = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l110" > < / 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 > 16< / span > < span class = cF0 > ; i++) < / span > < span class = cF2 > //Checksum< / span > < span class = cF0 >
< a name = "l111" > < / a > j += et-> w[i];
< a name = "l112" > < / a >
< a name = "l113" > < / a > et-> w[< / span > < span class = cFE > 14< / span > < span class = cF0 > ] = -j;
< a name = "l114" > < / a > et-> bootable = < / span > < span class = cFE > 0x88< / span > < span class = cF0 > ;
< a name = "l115" > < / a > et-> media_type = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;< / span > < span class = cF2 > //0=no emu 2=1.44meg 4=hard drive< / span > < span class = cF0 >
< a name = "l116" > < / a > et-> sect_count = < / span > < span class = cFE > 4< / span > < span class = cF0 > ; < / span > < span class = cF2 > //5 seems like the limit, 4 is safer< / span > < span class = cF0 >
< a name = "l117" > < / a > et-> load_rba = < / span > < span class = cFE > 20< / span > < span class = cF0 > < < < / span > < span class = cFE > 2< / span > < span class = cF0 > > > < / span > < span class = cFE > 2< / span > < span class = cF0 > + < / span > < span class = cFE > 1< / span > < span class = cF0 > ;
< a name = "l118" > < / a > < / span > < span class = cF5 > FBlkWrite< / span > < span class = cF0 > (out_file, et, < / span > < span class = cFE > 20< / span > < span class = cF0 > < < < / span > < span class = cFE > 2< / span > < span class = cF0 > , < / span > < span class = cFE > 4< / span > < span class = cF0 > );
< a name = "l119" > < / a > < / span > < span class = cF5 > FClose< / span > < span class = cF0 > (out_file);
< a name = "l120" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l121" > < / a > < / span > < span class = cF5 > Free< / span > < span class = cF0 > (zero_buf);
< a name = "l122" > < / a > < / span > < span class = cF5 > Free< / span > < span class = cF0 > (et);
< a name = "l123" > < / a > < / span > < span class = cF5 > Free< / span > < span class = cF0 > (iso_pri);
< a name = "l124" > < / a > < / span > < span class = cF5 > Free< / span > < span class = cF0 > (iso_boot);
< a name = "l125" > < / a > < / span > < span class = cF5 > Free< / span > < span class = cF0 > (iso_sup);
< a name = "l126" > < / a > < / span > < span class = cF5 > Free< / span > < span class = cF0 > (iso_term);
< a name = "l127" > < / a > }
2021-07-03 05:07:57 +01:00
< a name = "l128" > < / a >
2021-08-13 23:46:15 +01:00
< a name = "l129" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > < / span > < span class = cF5 > RedSeaISOPass1< / span > < span class = cF0 > (< / span > < span class = cF9 > CDirEntry< / span > < span class = cF0 > *tmpde)
< a name = "l130" > < / a > {
< a name = "l131" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > dir_entry_count = < / span > < span class = cFE > 3< / span > < span class = cF0 > + < / span > < span class = cF5 > LinkedListCount< / span > < span class = cF0 > (tmpde), res = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l132" > < / a >
< a name = "l133" > < / a > < / span > < span class = cF1 > while< / span > < span class = cF0 > (tmpde)
< a name = "l134" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l135" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (tmpde-> attr & < / span > < span class = cF3 > RS_ATTR_DIR< / span > < span class = cF0 > )
< a name = "l136" > < / a > {
< a name = "l137" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (tmpde-> sub)
< a name = "l138" > < / a > res += < / span > < span class = cF5 > RedSeaISOPass1< / span > < span class = cF0 > (tmpde-> sub);
< a name = "l139" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l140" > < / a > res += < / span > < span class = cF3 > BLK_SIZE< / span > < span class = cF0 > ; < / span > < span class = cF2 > //Empty dir< / span > < span class = cF0 >
< a name = "l141" > < / a > }
< a name = "l142" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l143" > < / a > res += < / span > < span class = cF5 > CeilU64< / span > < span class = cF0 > (tmpde-> size, < / span > < span class = cF3 > BLK_SIZE< / span > < span class = cF0 > );
2021-07-03 05:07:57 +01:00
< a name = "l144" > < / a >
2021-08-13 23:46:15 +01:00
< a name = "l145" > < / a > tmpde = tmpde-> next;
< a name = "l146" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l147" > < / a > res += < / span > < span class = cF5 > CeilU64< / span > < span class = cF0 > (dir_entry_count < < < / span > < span class = cFE > 6< / span > < span class = cF0 > , < / span > < span class = cF3 > BLK_SIZE< / span > < span class = cF0 > ); < / span > < span class = cF2 > //Size in bytes< / span > < span class = cF0 >
< a name = "l148" > < / a >
< a name = "l149" > < / a > #< / span > < span class = cF1 > assert< / span > < span class = cF0 > < / span > < span class = cF3 > CDIR_SIZE< / span > < span class = cF0 > == < / span > < span class = cFE > 64< / span > < span class = cF0 >
< a name = "l150" > < / a >
< a name = "l151" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > res;
< a name = "l152" > < / a > }
< a name = "l153" > < / a >
< a name = "l154" > < / a > < / span > < span class = cF1 > public< / span > < span class = cF0 > < / span > < span class = cF9 > I64< / span > < span class = cF0 > < / span > < span class = cF5 > RedSeaISO< / span > < span class = cF0 > (< / span > < span class = cF1 > U8< / span > < span class = cF0 > *_iso_filename=< / span > < span class = cF3 > NULL< / span > < span class = cF0 > , < / span > < span class = cF1 > U8< / span > < span class = cF0 > *_src_dir, < / span > < span class = cF1 > U8< / span > < span class = cF0 > *_stage2_filename=< / span > < span class = cF3 > NULL< / span > < span class = cF0 > )
< a name = "l155" > < / a > {< / span > < span class = cF2 > //See < / span > < a href = "https://zeal-operating-system.github.io/ZealOS/Misc/DoDistro.CC.html#l1" > < span class = cF4 > ::/Misc/DoDistro.CC< / span > < / a > < span class = cF2 > . Must be ISO.C< / span > < span class = cF0 >
< a name = "l156" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > i, res, root_count, root_dir_blks, bitmap_blks, bitmap_blks1;
< a name = "l157" > < / a > < / span > < span class = cF9 > CDirEntry< / span > < span class = cF0 > *tmpde;
< a name = "l158" > < / a > < / span > < span class = cF1 > U8< / span > < span class = cF0 > buf[< / span > < span class = cF3 > STR_LEN< / span > < span class = cF0 > ], *iso_filename, *src_dir, *stage2_filename;
2021-08-16 05:52:03 +01:00
< a name = "l159" > < / a > < / span > < span class = cF9 > CDrive< / span > < span class = cF0 > *drive = < / span > < span class = cF5 > DriveMakeFreeSlot< / span > < span class = cF0 > (< / span > < span class = cF5 > DriveNextFreeLet< / span > < span class = cF7 > (< / span > < span class = cF6 > 'Q'< / span > < span class = cF7 > )< / span > < span class = cF0 > ); < / span > < span class = cF2 > //First < / span > < a href = "https://zeal-operating-system.github.io/ZealOS/Kernel/KernelA.HH.html#l3281" > < span class = cF4 > BDT_ISO_FILE_WRITE< / span > < / a > < span class = cF0 >
2021-08-13 23:46:15 +01:00
< a name = "l160" > < / a > < / span > < span class = cF9 > CBlkDev< / span > < span class = cF0 > *bd = < / span > < span class = cF5 > BlkDevNextFreeSlot< / span > < span class = cF0 > (drive-> drv_let, < / span > < span class = cF3 > BDT_ISO_FILE_WRITE< / span > < span class = cF0 > );
< a name = "l161" > < / a >
< a name = "l162" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!< / span > < span class = cF5 > IsDir< / span > < span class = cF7 > (< / span > < span class = cF0 > _src_dir< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l163" > < / a > < / span > < span class = cF5 > PrintErr< / span > < span class = cF0 > (< / span > < span class = cF6 > " '%s' is not a dir.\n" < / span > < span class = cF0 > , _src_dir);
< a name = "l164" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l165" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l166" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!_iso_filename)
< a name = "l167" > < / a > _iso_filename = < / span > < span class = cFB > blkdev< / span > < span class = cF0 > .default_iso_c_filename;
< a name = "l168" > < / a >
< a name = "l169" > < / a > iso_filename = < / span > < span class = cF5 > ExtChange< / span > < span class = cF0 > (_iso_filename, < / span > < span class = cF6 > " ISO.C" < / span > < span class = cF0 > );
< a name = "l170" > < / a > src_dir = < / span > < span class = cF5 > DirNameAbs< / span > < span class = cF0 > (_src_dir);
< a name = "l171" > < / a >
< a name = "l172" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (_stage2_filename)
< a name = "l173" > < / a > {
< a name = "l174" > < / a > stage2_filename = < / span > < span class = cF5 > FileNameAbs< / span > < span class = cF0 > (_stage2_filename);
< a name = "l175" > < / a > *stage2_filename = drive-> drv_let;
2021-07-03 05:07:57 +01:00
< a name = "l176" > < / a >
2021-08-13 23:46:15 +01:00
< a name = "l177" > < / a > i = < / span > < span class = cF5 > StrLen< / span > < span class = cF0 > (src_dir);
< a name = "l178" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (i != < / span > < span class = cFE > 3< / span > < span class = cF0 > ) < / span > < span class = cF2 > //If not root< / span > < span class = cF0 >
< a name = "l179" > < / a > i++; < / span > < span class = cF2 > //Skip slash< / span > < span class = cF0 >
< a name = "l180" > < / a >
< a name = "l181" > < / a > < / span > < span class = cF5 > StrCopy< / span > < span class = cF0 > (stage2_filename + < / span > < span class = cFE > 3< / span > < span class = cF0 > , stage2_filename + i);
< a name = "l182" > < / a > }
< a name = "l183" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l184" > < / a > stage2_filename = < / span > < span class = cF3 > NULL< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l185" > < / a >
2021-08-13 23:46:15 +01:00
< a name = "l186" > < / a > tmpde = < / span > < span class = cF5 > FilesFind< / span > < span class = cF0 > (src_dir, < / span > < span class = cF3 > FUF_RECURSE< / span > < span class = cF0 > );
< a name = "l187" > < / a > root_count = < / span > < span class = cF5 > LinkedListCount< / span > < span class = cF0 > (tmpde) + < / span > < span class = cFE > 3< / span > < span class = cF0 > ;
< a name = "l188" > < / a > root_dir_blks = < / span > < span class = cF5 > CeilU64< / span > < span class = cF0 > (root_count < < < / span > < span class = cFE > 6< / span > < span class = cF0 > , < / span > < span class = cF3 > BLK_SIZE< / span > < span class = cF0 > ) > > < / span > < span class = cF3 > BLK_SIZE_BITS< / span > < span class = cF0 > ;
< a name = "l189" > < / a >
< a name = "l190" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (res = < / span > < span class = cF5 > RedSeaISOPass1< / span > < span class = cF7 > (< / span > < span class = cF0 > tmpde< / span > < span class = cF7 > )< / span > < span class = cF0 > > > < / span > < span class = cF3 > BLK_SIZE_BITS< / span > < span class = cF0 > )
< a name = "l191" > < / a > {
< a name = "l192" > < / a > bd-> drv_offset = < / span > < span class = cFE > 19< / span > < span class = cF0 > < < < / span > < span class = cFE > 2< / span > < span class = cF0 > + (< / span > < span class = cF3 > DVD_BLK_SIZE< / span > < span class = cF0 > * < / span > < span class = cFE > 2< / span > < span class = cF0 > + < / span > < span class = cF3 > DVD_BOOT_LOADER_SIZE< / span > < span class = cF0 > ) / < / span > < span class = cF3 > BLK_SIZE< / span > < span class = cF0 > ;
< a name = "l193" > < / a > bitmap_blks = < / span > < span class = cFE > 1< / span > < span class = cF0 > ;
< a name = "l194" > < / a > < / span > < span class = cF1 > do< / span > < span class = cF0 >
< a name = "l195" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l196" > < / a > bitmap_blks1 = bitmap_blks;
< a name = "l197" > < / a > bitmap_blks = (res + bitmap_blks + < / span > < span class = cF3 > BLK_SIZE< / span > < span class = cF0 > < < < / span > < span class = cFE > 3< / span > < span class = cF0 > - < / span > < span class = cFE > 1< / span > < span class = cF0 > ) / < / span > < span class = cF3 > BLK_SIZE< / span > < span class = cF0 > < < < / span > < span class = cFE > 3< / span > < span class = cF0 > ;
< a name = "l198" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l199" > < / a > < / span > < span class = cF1 > while< / span > < span class = cF0 > (bitmap_blks != bitmap_blks1);
< a name = "l200" > < / a >
< a name = "l201" > < / a > bd-> max_blk = < / span > < span class = cF5 > CeilI64< / span > < span class = cF0 > (bd-> drv_offset + < / span > < span class = cFE > 1< / span > < span class = cF0 > + bitmap_blks + res, < / span > < span class = cFE > 4< / span > < span class = cF0 > );
< a name = "l202" > < / a > bd-> max_blk--; < / span > < span class = cF2 > //Inclusive.< / span > < span class = cF0 >
< a name = "l203" > < / a > bd-> file_disk_name = < / span > < span class = cF5 > SysStrNew< / span > < span class = cF0 > (iso_filename);
< a name = "l204" > < / a > bd-> init_root_dir_blks = root_dir_blks;
< a name = "l205" > < / a > < / span > < span class = cF5 > BlkDevAdd< / span > < span class = cF0 > (bd,, < / span > < span class = cF3 > TRUE< / span > < span class = cF0 > , < / span > < span class = cF3 > TRUE< / span > < span class = cF0 > );
< a name = "l206" > < / a > < / span > < span class = cF5 > StrPrint< / span > < span class = cF0 > (buf, < / span > < span class = cF6 > " %C:/" < / span > < span class = cF0 > , drive-> drv_let);
< a name = "l207" > < / a > < / span > < span class = cF5 > CopyTree< / span > < span class = cF0 > (src_dir, buf, < / span > < span class = cF3 > TRUE< / span > < span class = cF0 > );
< a name = "l208" > < / a > < / span > < span class = cF5 > RedSeaISO9660Stage1< / span > < span class = cF0 > (iso_filename, stage2_filename);
< a name = "l209" > < / a > < / span > < span class = cF5 > DriveDel< / span > < span class = cF0 > (drive);
< a name = "l210" > < / a > < / span > < span class = cF5 > BlkDevDel< / span > < span class = cF0 > (bd);
< a name = "l211" > < / a > }
< a name = "l212" > < / a > < / span > < span class = cF5 > Free< / span > < span class = cF0 > (stage2_filename);
< a name = "l213" > < / a > < / span > < span class = cF5 > Free< / span > < span class = cF0 > (src_dir);
< a name = "l214" > < / a > < / span > < span class = cF5 > Free< / span > < span class = cF0 > (iso_filename);
< a name = "l215" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l216" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > res;
< a name = "l217" > < / a > }
2021-07-03 05:07:57 +01:00
< / span > < / pre > < / body >
< / html >