mirror of
				https://gitlab.com/bztsrc/bootboot.git
				synced 2023-02-13 20:54:32 -05:00 
			
		
		
		
	Fixed FAT parsing on RPi
This commit is contained in:
		
							parent
							
								
									bf82d5c686
								
							
						
					
					
						commit
						cb2d2eb76b
					
				
					 8 changed files with 12 additions and 12 deletions
				
			
		| 
						 | 
					@ -5,7 +5,7 @@ Előre lefordított binárisok mellékelve, egyből használhatók.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
1. *x86_64-efi* a preferált indítási mód x86_64-en.
 | 
					1. *x86_64-efi* a preferált indítási mód x86_64-en.
 | 
				
			||||||
    Szabvány GNU eszköztár plusz néhány fájl a gnuefi-ből (mellékelve).
 | 
					    Szabvány GNU eszköztár plusz néhány fájl a gnuefi-ből (mellékelve).
 | 
				
			||||||
    [bootboot.efi](https://gitlab.com/bztsrc/bootboot/raw/master/dist/bootboot.efi) (101k), [bootboot.rom](https://gitlab.com/bztsrc/bootboot/raw/master/dist/bootboot.rom) (101k)
 | 
					    [bootboot.efi](https://gitlab.com/bztsrc/bootboot/raw/master/dist/bootboot.efi) (103k), [bootboot.rom](https://gitlab.com/bztsrc/bootboot/raw/master/dist/bootboot.rom) (103k)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
2. *x86_64-bios* BIOS, Multiboot (GRUB), El Torito (CDROM), bővítő ROM és Linux boot kompatíbilis, RÉGI betöltő.
 | 
					2. *x86_64-bios* BIOS, Multiboot (GRUB), El Torito (CDROM), bővítő ROM és Linux boot kompatíbilis, RÉGI betöltő.
 | 
				
			||||||
    Ha újra akarod fordítani, szükséged lesz a fasm-ra (nincs mellékelve).
 | 
					    Ha újra akarod fordítani, szükséged lesz a fasm-ra (nincs mellékelve).
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -5,7 +5,7 @@ I provide pre-compiled images ready for use.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
1. *x86_64-efi* the preferred way of booting on x86_64 architecture.
 | 
					1. *x86_64-efi* the preferred way of booting on x86_64 architecture.
 | 
				
			||||||
    Standard GNU toolchain and a few files from gnuefi (included).
 | 
					    Standard GNU toolchain and a few files from gnuefi (included).
 | 
				
			||||||
    [bootboot.efi](https://gitlab.com/bztsrc/bootboot/raw/master/dist/bootboot.efi) (101k), [bootboot.rom](https://gitlab.com/bztsrc/bootboot/raw/master/dist/bootboot.rom) (101k)
 | 
					    [bootboot.efi](https://gitlab.com/bztsrc/bootboot/raw/master/dist/bootboot.efi) (103k), [bootboot.rom](https://gitlab.com/bztsrc/bootboot/raw/master/dist/bootboot.rom) (103k)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
2. *x86_64-bios* BIOS, Multiboot (GRUB), El Torito (CDROM), Expansion ROM and Linux boot compatible, OBSOLETE loader.
 | 
					2. *x86_64-bios* BIOS, Multiboot (GRUB), El Torito (CDROM), Expansion ROM and Linux boot compatible, OBSOLETE loader.
 | 
				
			||||||
    If you want to recompile this, you'll need fasm (not included).
 | 
					    If you want to recompile this, you'll need fasm (not included).
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1363,7 +1363,7 @@ diskerr:
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        s3=bpb->spc*512;
 | 
					        s3=bpb->spc*512;
 | 
				
			||||||
        // load fat table
 | 
					        // load fat table
 | 
				
			||||||
        r=sd_readblock(part->start+1,(unsigned char*)&_end+512,(bpb->spf16?bpb->spf16:bpb->spf32)+bpb->rsc);
 | 
					        r=sd_readblock(part->start+bpb->rsc,(unsigned char*)&_end+512,(bpb->spf16?bpb->spf16:bpb->spf32));
 | 
				
			||||||
        if(r==0) goto diskerr;
 | 
					        if(r==0) goto diskerr;
 | 
				
			||||||
        pe=(uint8_t*)&_end+512+r;
 | 
					        pe=(uint8_t*)&_end+512+r;
 | 
				
			||||||
        // load root directory
 | 
					        // load root directory
 | 
				
			||||||
| 
						 | 
					@ -1377,12 +1377,12 @@ diskerr:
 | 
				
			||||||
        // locate environment and initrd
 | 
					        // locate environment and initrd
 | 
				
			||||||
        while(dir->name[0]!=0) {
 | 
					        while(dir->name[0]!=0) {
 | 
				
			||||||
            if(!memcmp(dir->name,"CONFIG     ",11)) {
 | 
					            if(!memcmp(dir->name,"CONFIG     ",11)) {
 | 
				
			||||||
                s=dir->size<PAGESIZE?dir->size:PAGESIZE; // round up to cluster size
 | 
					                s=dir->size<PAGESIZE?dir->size:PAGESIZE;
 | 
				
			||||||
                cclu=dir->cl+(dir->ch<<16);
 | 
					                cclu=dir->cl+(dir->ch<<16);
 | 
				
			||||||
                ptr=(void*)&__environment;
 | 
					                ptr=(void*)&__environment;
 | 
				
			||||||
                while(s>0) {
 | 
					                while(s>0) {
 | 
				
			||||||
                    s2=s>s3?s3:s;
 | 
					                    s2=s>s3?s3:s;
 | 
				
			||||||
                    r=sd_readblock(part->start+(cclu-2)*bpb->spc+data_sec,ptr,s2<512?1:(s2+511)/512);
 | 
					                    r=sd_readblock(part->start+(cclu-2)*bpb->spc+data_sec,ptr,bpb->spc);
 | 
				
			||||||
                    cclu=bpb->spf16>0?fat16[cclu]:fat32[cclu];
 | 
					                    cclu=bpb->spf16>0?fat16[cclu]:fat32[cclu];
 | 
				
			||||||
                    ptr+=s2;
 | 
					                    ptr+=s2;
 | 
				
			||||||
                    s-=s2;
 | 
					                    s-=s2;
 | 
				
			||||||
| 
						 | 
					@ -1412,7 +1412,7 @@ diskerr:
 | 
				
			||||||
            s=initrd.size;
 | 
					            s=initrd.size;
 | 
				
			||||||
            while(s>0) {
 | 
					            while(s>0) {
 | 
				
			||||||
                s2=s>s3?s3:s;
 | 
					                s2=s>s3?s3:s;
 | 
				
			||||||
                r=sd_readblock(part->start+(clu-2)*bpb->spc+data_sec,ptr,s2<512?1:(s2+511)/512);
 | 
					                r=sd_readblock(part->start+(clu-2)*bpb->spc+data_sec,ptr,bpb->spc);
 | 
				
			||||||
                clu=bpb->spf16>0?fat16[clu]:fat32[clu];
 | 
					                clu=bpb->spf16>0?fat16[clu]:fat32[clu];
 | 
				
			||||||
                ptr+=s2;
 | 
					                ptr+=s2;
 | 
				
			||||||
                s-=s2;
 | 
					                s-=s2;
 | 
				
			||||||
| 
						 | 
					@ -1420,7 +1420,7 @@ diskerr:
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
        // initrd is on the entire partition
 | 
					        // initrd is on the entire partition
 | 
				
			||||||
        r=sd_readblock(part->start,(unsigned char*)&_end+512,part->end-part->start);
 | 
					        r=sd_readblock(part->start,(unsigned char*)&_end+512,part->end-part->start+1);
 | 
				
			||||||
        if(r==0) goto diskerr;
 | 
					        if(r==0) goto diskerr;
 | 
				
			||||||
        initrd.ptr=(uint8_t*)&_end;
 | 
					        initrd.ptr=(uint8_t*)&_end;
 | 
				
			||||||
        initrd.size=r;
 | 
					        initrd.size=r;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										
											BIN
										
									
								
								dist/bootboot.efi
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								dist/bootboot.efi
									
										
									
									
										vendored
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								dist/bootboot.img
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								dist/bootboot.img
									
										
									
									
										vendored
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								dist/bootboot.rom
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								dist/bootboot.rom
									
										
									
									
										vendored
									
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| 
						 | 
					@ -5,9 +5,9 @@ extern unsigned char binary_boot_bin[512];
 | 
				
			||||||
#define sizeof_bootboot_bin 13312
 | 
					#define sizeof_bootboot_bin 13312
 | 
				
			||||||
extern unsigned char binary_bootboot_bin[9284];
 | 
					extern unsigned char binary_bootboot_bin[9284];
 | 
				
			||||||
#define sizeof_bootboot_efi 103614
 | 
					#define sizeof_bootboot_efi 103614
 | 
				
			||||||
extern unsigned char binary_bootboot_efi[46349];
 | 
					extern unsigned char binary_bootboot_efi[46348];
 | 
				
			||||||
#define sizeof_bootboot_img 35384
 | 
					#define sizeof_bootboot_img 35344
 | 
				
			||||||
extern unsigned char binary_bootboot_img[20069];
 | 
					extern unsigned char binary_bootboot_img[20050];
 | 
				
			||||||
#define sizeof_bootboot_rv64 8192
 | 
					#define sizeof_bootboot_rv64 8192
 | 
				
			||||||
extern unsigned char binary_bootboot_rv64[31];
 | 
					extern unsigned char binary_bootboot_rv64[31];
 | 
				
			||||||
#define sizeof_LICENCE_broadcom 1594
 | 
					#define sizeof_LICENCE_broadcom 1594
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue