diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-05-22 15:22:46 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-05-22 15:22:46 +0200 |
commit | 66b1a83b7468fe35e11996ca1b12d00fe41f75c5 (patch) | |
tree | 7de7c7f38ef84f4d0dd5f45fe6bdbd7375a3b7c3 /sys | |
parent | 9adaf2e7f8a81eb207eb7894e80864019950e0e7 (diff) |
efi: allow access to iso filesystem on non-cdrom media (iso/hybrid)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/src/boot/efi/iso.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/src/boot/efi/iso.c b/sys/src/boot/efi/iso.c index b11e19d2e..f994419cd 100644 --- a/sys/src/boot/efi/iso.c +++ b/sys/src/boot/efi/iso.c @@ -73,6 +73,7 @@ static EFI_BLOCK_IO_PROTOCOL *bio; static int readsect(ulong lba, void *buf) { + lba *= Sectsz/bio->Media->BlockSize; return eficall(bio->ReadBlocks, bio, (UINTN)bio->Media->MediaId, (UINT64)lba, (UINTN)Sectsz, buf); } @@ -117,11 +118,15 @@ isowalk(Extend *ex, char *path) for(i=0x10; i<0x1000; i++){ if(readsect(i, ex->buf)) return -1; - if(*ex->buf == 1) - break; + if(memcmp(ex->buf, "\001CD001\001", 7) == 0) + goto Foundpvd; } + return -1; +Foundpvd: ex->lba = *((ulong*)(ex->buf + 156 + 2)); ex->len = *((ulong*)(ex->buf + 156 + 10)); + if(*path == 0) + return 0; for(;;){ if(readn(ex, &d, Dirsz) != Dirsz) @@ -197,9 +202,9 @@ isoinit(void **fp) media = bio->Media; if(media != nil && media->MediaPresent - && media->RemovableMedia && media->LogicalPartition == 0 - && media->BlockSize == Sectsz) + && media->BlockSize != 0 + && isoopen("") != nil) goto Found; } return -1; |