Chameleon

Chameleon Commit Details

Date:2014-02-02 16:27:40 (5 years 8 months ago)
Author:Jief Luce
Commit:2369
Parents: 2368
Message:Clean sector signature
Changes:
M/branches/Jief/i386/boot0/boot0.s
M/branches/Jief/i386/boot1/boot1h.s

File differences

branches/Jief/i386/boot0/boot0.s
406406
407407
408408
409
409
410410
411411
412412
......
415415
416416
417417
418
418
419419
420420
421421
......
658658
659659
660660
661
662
661
663662
664663
665664
loadBootSector:
pusha
mov al, 3
mov al, 2
mov bx, kBoot0LoadAddr
call load
jc error
; Check for chameleon boot block signature of boot1h
;
mov di, bx
cmp WORD [di + kSectorBytes - 4], kChameleonBoot1hSignature
cmp WORD [di + kSectorBytes*2 - 2], kChameleonBoot1hSignature
.exit:
popa
times 440-($-$$) db 0
pad_table_and_sig:
times 508-($-$$) db 0
dw kChameleonBoot1hSignature
times 510-($-$$) db 0
dw kBootSignature
branches/Jief/i386/boot1/boot1h.s
7777
7878
7979
80
80
8181
8282
8383
......
466466
467467
468468
469
470469
470
471471
472472
473473
474474
475475
476476
477
477478
478479
479480
......
492493
493494
494495
496
495497
496498
499
497500
498501
499502
......
10071010
10081011
10091012
1010
1011
1012
10131013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
10271014
10281015
10291016
......
14831470
14841471
14851472
1486
1473
14871474
14881475
14891476
kBoot1Sector1AddrEQUkBoot1RelocAddr + kSectorBytes; boot1 load address for sector 1
kHFSPlusBufferEQUkBoot1Sector1Addr + kSectorBytes; HFS+ Volume Header address
kBoot2SectorsEQU(448 * 1024 - 512) / kSectorBytes; max size of 'boot' file in sectors
kBoot2SectorsEQU(1000000) / kSectorBytes; max size of 'boot' file in sectors
kBoot2SegmentEQU0x2000; boot2 load segment
kBoot2AddressEQUkSectorBytes; boot2 load address
; Find stage2 boot file in a HFS+ Volume's root folder.
;
findRootBoot:
PrintChar ('!')
;%if 0
; PrintChar ('a')
moval, kHFSCatalogFileID
leasi, [searchCatalogKey]
leadi, [kHFSPlusBuffer + HFSPlusVolumeHeader.catalogFile + HFSPlusForkData.extents]
calllookUpBTree
jneerror
; PrintChar ('b')
leasi, [bp + BTree.recordDataPtr]
movsi, [si]
cmpWORD [si], kHFSPlusFileRecord
bswapebx; convert file size to little-endian
addebx, kSectorBytes - 1; adjust size before unit conversion
shrebx, 9; convert file size to sector unit
PrintChar ('d')
cmpbx, kBoot2Sectors; check if bigger than max stage2 size
jaerror
PrintChar ('e')
moveax, [si + HFSPlusCatalogFile.fileID]
bswapeax; convert fileID to little-endian
xorecx, ecx
%endif ; UNUSED
;--------------------------------------------------------------------------
; Pad the rest of the 512 byte sized sector with zeroes. The last
; two bytes is the mandatory boot sector signature.
;
; If the booter code becomes too large, then nasm will complain
; that the 'times' argument is negative.
;
; XXX - compilation errors with debug enabled (see comment above about nasm)
; Azi: boot1h.s:994: error: TIMES value -67 is negative
;
pad_table_and_sig:
times508-($-$$) db 0
dw kChameleonBoot1hSignature
dwkBootSignature ; remove this ! Don't forgot boot0.s, line 419 : -4 become -2
;
; Sector 1 code area
;
;
pad_sector_1:
times1022-($-$$) db 0
dwkBootSignature
dwkChameleonBoot1hSignature
;
; Local BTree variables

Archive Download the corresponding diff file

Revision: 2369