mirror of
https://gitlab.com/bztsrc/bootboot.git
synced 2023-02-13 20:54:32 -05:00
Added more FS/Z feature
This commit is contained in:
parent
039bd191de
commit
5f53dbf717
10 changed files with 28 additions and 16 deletions
|
@ -65,7 +65,7 @@ _start:
|
||||||
mrs x0, cnthctl_el2
|
mrs x0, cnthctl_el2
|
||||||
orr x0, x0, #3
|
orr x0, x0, #3
|
||||||
msr cnthctl_el2, x0
|
msr cnthctl_el2, x0
|
||||||
msr cntvoff_el2, xzr
|
msr cnthp_ctl_el2, xzr
|
||||||
// initialize virtual MPIDR
|
// initialize virtual MPIDR
|
||||||
mrs x0, midr_el1
|
mrs x0, midr_el1
|
||||||
mrs x2, mpidr_el1
|
mrs x2, mpidr_el1
|
||||||
|
@ -101,6 +101,11 @@ _start:
|
||||||
mrs x7, mpidr_el1
|
mrs x7, mpidr_el1
|
||||||
and x7, x7, #3
|
and x7, x7, #3
|
||||||
cbnz x7, 3f
|
cbnz x7, 3f
|
||||||
|
// failsafe: if startup.elf does not start all cores (depends on config.txt)
|
||||||
|
mov x2, #0x40000000
|
||||||
|
str w1, [x2, #0x9C] // write _start address to core1's mailbox 3
|
||||||
|
str w1, [x2, #0xAC] // write _start address to core2's mailbox 3
|
||||||
|
str w1, [x2, #0xBC] // write _start address to core3's mailbox 3
|
||||||
// clear bss
|
// clear bss
|
||||||
ldr x2, =__bss_start
|
ldr x2, =__bss_start
|
||||||
ldr w3, =__bss_size
|
ldr w3, =__bss_size
|
||||||
|
|
|
@ -1563,7 +1563,7 @@ gzerr: puts("BOOTBOOT-PANIC: Unable to uncompress\n");
|
||||||
mmap++; bootboot->size+=sizeof(MMapEnt);
|
mmap++; bootboot->size+=sizeof(MMapEnt);
|
||||||
|
|
||||||
// MMIO area
|
// MMIO area
|
||||||
mmap->ptr=MMIO_BASE; mmap->size=((uint64_t)0x40000000-MMIO_BASE) | MMAP_MMIO;
|
mmap->ptr=MMIO_BASE; mmap->size=((uint64_t)0x40200000-MMIO_BASE) | MMAP_MMIO;
|
||||||
mmap++; bootboot->size+=sizeof(MMapEnt);
|
mmap++; bootboot->size+=sizeof(MMapEnt);
|
||||||
|
|
||||||
#if MEM_DEBUG
|
#if MEM_DEBUG
|
||||||
|
|
|
@ -97,8 +97,8 @@ again:
|
||||||
if(*e=='/'){e++;}
|
if(*e=='/'){e++;}
|
||||||
if(!memcmp(in->magic,FSZ_IN_MAGIC,4)){
|
if(!memcmp(in->magic,FSZ_IN_MAGIC,4)){
|
||||||
//is it inlined?
|
//is it inlined?
|
||||||
if(!memcmp(in->data.small.inlinedata,FSZ_DIR_MAGIC,4)){
|
if(!memcmp(sb->flags&FSZ_SB_FLAG_BIGINODE? in->data.big.inlinedata : in->data.small.inlinedata,FSZ_DIR_MAGIC,4)){
|
||||||
ent=(FSZ_DirEnt *)(in->data.small.inlinedata);
|
ent=(FSZ_DirEnt *)(sb->flags&FSZ_SB_FLAG_BIGINODE? in->data.big.inlinedata : in->data.small.inlinedata);
|
||||||
} else if(!memcmp(initrd_p+in->sec*ss,FSZ_DIR_MAGIC,4)){
|
} else if(!memcmp(initrd_p+in->sec*ss,FSZ_DIR_MAGIC,4)){
|
||||||
// go, get the sector pointed
|
// go, get the sector pointed
|
||||||
ent=(FSZ_DirEnt *)(initrd_p+in->sec*ss);
|
ent=(FSZ_DirEnt *)(initrd_p+in->sec*ss);
|
||||||
|
@ -138,7 +138,8 @@ again:
|
||||||
case FSZ_IN_FLAG_SECLIST:
|
case FSZ_IN_FLAG_SECLIST:
|
||||||
case FSZ_IN_FLAG_SDINLINE:
|
case FSZ_IN_FLAG_SDINLINE:
|
||||||
// sector directory or list inlined
|
// sector directory or list inlined
|
||||||
ret.ptr=(uint8_t*)(initrd_p + *((uint64_t*)&in->data.small.inlinedata) * ss);
|
ret.ptr=(uint8_t*)(initrd_p + *(sb->flags&FSZ_SB_FLAG_BIGINODE?
|
||||||
|
(uint64_t*)&in->data.big.inlinedata : (uint64_t*)&in->data.small.inlinedata) * ss);
|
||||||
break;
|
break;
|
||||||
case FSZ_IN_FLAG_DIRECT:
|
case FSZ_IN_FLAG_DIRECT:
|
||||||
// direct data
|
// direct data
|
||||||
|
|
BIN
bootboot.bin
BIN
bootboot.bin
Binary file not shown.
BIN
bootboot.efi
BIN
bootboot.efi
Binary file not shown.
BIN
bootboot.img
BIN
bootboot.img
Binary file not shown.
BIN
bootboot.rom
BIN
bootboot.rom
Binary file not shown.
|
@ -202,7 +202,12 @@ fsz_initrd:
|
||||||
pop edi
|
pop edi
|
||||||
|
|
||||||
; get root dir inode
|
; get root dir inode
|
||||||
.noenc: mov eax, dword [esi+560] ; FSZ_SuperBlock.rootdirfid
|
.noenc: mov dword [_i], 1024
|
||||||
|
mov al, byte [esi+518] ; FSZ_SuperBlock.flags
|
||||||
|
bt ax, 0 ; FSZ_FLAG_BIGINODE?
|
||||||
|
jnc @f
|
||||||
|
mov dword [_i], 2048
|
||||||
|
@@: mov eax, dword [esi+560] ; FSZ_SuperBlock.rootdirfid
|
||||||
shl eax, 12
|
shl eax, 12
|
||||||
add esi, eax
|
add esi, eax
|
||||||
cmp dword [esi], 'FSIN'
|
cmp dword [esi], 'FSIN'
|
||||||
|
@ -213,12 +218,12 @@ fsz_initrd:
|
||||||
.nocore: mov esi, nocore
|
.nocore: mov esi, nocore
|
||||||
jmp .err
|
jmp .err
|
||||||
@@: ; it has inlined data?
|
@@: ; it has inlined data?
|
||||||
.again: add esi, 1024 ; FSZ_Inode.inlinedata
|
.again: mov eax, dword [esi+448] ; FSZ_Inode.sec
|
||||||
|
add esi, dword[_i] ; FSZ_Inode.[big|small].inlinedata
|
||||||
cmp dword [esi], 'FSDR'
|
cmp dword [esi], 'FSDR'
|
||||||
je .srchdir
|
je .srchdir
|
||||||
; no, locate the data
|
; no, locate the data
|
||||||
mov ecx, dword [esi]
|
mov ecx, dword [esi]
|
||||||
mov eax, dword [esi-1024+448] ; FSZ_Inode.sec
|
|
||||||
shl eax, 12
|
shl eax, 12
|
||||||
mov esi, dword [bootboot.initrd_ptr]
|
mov esi, dword [bootboot.initrd_ptr]
|
||||||
add esi, eax
|
add esi, eax
|
||||||
|
@ -254,12 +259,12 @@ fsz_initrd:
|
||||||
je .again
|
je .again
|
||||||
|
|
||||||
; it has inlined data?
|
; it has inlined data?
|
||||||
add esi, 1024 ; FSZ_Inode.inlinedata
|
mov eax, dword [esi+448] ; FSZ_Inode.sec
|
||||||
|
add esi, dword[_i] ; FSZ_Inode.[big|small].inlinedata
|
||||||
cmp dword [esi], 'FSDR'
|
cmp dword [esi], 'FSDR'
|
||||||
je .srchcore
|
je .srchcore
|
||||||
; no, locate the data
|
; no, locate the data
|
||||||
mov ecx, dword [esi]
|
mov ecx, dword [esi]
|
||||||
mov eax, dword [esi-1024+448] ; FSZ_Inode.sec
|
|
||||||
shl eax, 12
|
shl eax, 12
|
||||||
mov esi, dword [bootboot.initrd_ptr]
|
mov esi, dword [bootboot.initrd_ptr]
|
||||||
add esi, eax
|
add esi, eax
|
||||||
|
@ -300,7 +305,7 @@ fsz_initrd:
|
||||||
; inline
|
; inline
|
||||||
cmp bl, 0FFh ; FSZ_IN_FLAG_INLINE
|
cmp bl, 0FFh ; FSZ_IN_FLAG_INLINE
|
||||||
jne @f
|
jne @f
|
||||||
add esi, 1024
|
add esi, dword[_i] ; FSZ_Inode.[big|small].inlinedata
|
||||||
ret
|
ret
|
||||||
; direct data block
|
; direct data block
|
||||||
@@: or bl, bl ; FSZ_IN_FLAG_DIRECT
|
@@: or bl, bl ; FSZ_IN_FLAG_DIRECT
|
||||||
|
@ -317,7 +322,7 @@ fsz_initrd:
|
||||||
add esi, eax
|
add esi, eax
|
||||||
mov eax, dword [esi] ; first FSZ_SectorList.sec
|
mov eax, dword [esi] ; first FSZ_SectorList.sec
|
||||||
jmp .load
|
jmp .load
|
||||||
@@: add esi, 1024
|
@@: add esi, dword[_i] ; FSZ_Inode.[big|small].inlinedata
|
||||||
; sector directory at esi, file size in ecx
|
; sector directory at esi, file size in ecx
|
||||||
mov eax, dword [esi] ; first FSZ_SectorList.sec
|
mov eax, dword [esi] ; first FSZ_SectorList.sec
|
||||||
.load: shl eax, 12
|
.load: shl eax, 12
|
||||||
|
|
|
@ -1549,7 +1549,7 @@ gzerr: return report(EFI_COMPROMISED_DATA,L"Unable to uncompress");
|
||||||
CopyMem((void *)&(bootboot->arch.x86_64.efi_ptr),&systab,8);
|
CopyMem((void *)&(bootboot->arch.x86_64.efi_ptr),&systab,8);
|
||||||
|
|
||||||
// System tables and structures
|
// System tables and structures
|
||||||
DBG(L" * System tables%s\n","");
|
DBG(L" * System tables%s\n",L"");
|
||||||
LibGetSystemConfigurationTable(&AcpiTableGuid,(void *)&(bootboot->arch.x86_64.acpi_ptr));
|
LibGetSystemConfigurationTable(&AcpiTableGuid,(void *)&(bootboot->arch.x86_64.acpi_ptr));
|
||||||
LibGetSystemConfigurationTable(&SMBIOSTableGuid,(void *)&(bootboot->arch.x86_64.smbi_ptr));
|
LibGetSystemConfigurationTable(&SMBIOSTableGuid,(void *)&(bootboot->arch.x86_64.smbi_ptr));
|
||||||
LibGetSystemConfigurationTable(&MpsTableGuid,(void *)&(bootboot->arch.x86_64.mp_ptr));
|
LibGetSystemConfigurationTable(&MpsTableGuid,(void *)&(bootboot->arch.x86_64.mp_ptr));
|
||||||
|
|
|
@ -98,8 +98,8 @@ again:
|
||||||
if(*e=='/'){e++;}
|
if(*e=='/'){e++;}
|
||||||
if(!CompareMem(in->magic,FSZ_IN_MAGIC,4)){
|
if(!CompareMem(in->magic,FSZ_IN_MAGIC,4)){
|
||||||
//is it inlined?
|
//is it inlined?
|
||||||
if(!CompareMem(in->data.small.inlinedata,FSZ_DIR_MAGIC,4)){
|
if(!CompareMem(sb->flags&FSZ_SB_FLAG_BIGINODE? in->data.big.inlinedata : in->data.small.inlinedata,FSZ_DIR_MAGIC,4)){
|
||||||
ent=(FSZ_DirEnt *)(in->data.small.inlinedata);
|
ent=(FSZ_DirEnt *)(sb->flags&FSZ_SB_FLAG_BIGINODE? in->data.big.inlinedata : in->data.small.inlinedata);
|
||||||
} else if(!CompareMem(initrd_p+in->sec*ss,FSZ_DIR_MAGIC,4)){
|
} else if(!CompareMem(initrd_p+in->sec*ss,FSZ_DIR_MAGIC,4)){
|
||||||
// go, get the sector pointed
|
// go, get the sector pointed
|
||||||
ent=(FSZ_DirEnt *)(initrd_p+in->sec*ss);
|
ent=(FSZ_DirEnt *)(initrd_p+in->sec*ss);
|
||||||
|
@ -139,7 +139,8 @@ again:
|
||||||
case FSZ_IN_FLAG_SECLIST:
|
case FSZ_IN_FLAG_SECLIST:
|
||||||
case FSZ_IN_FLAG_SDINLINE:
|
case FSZ_IN_FLAG_SDINLINE:
|
||||||
// sector directory or list inlined
|
// sector directory or list inlined
|
||||||
ret.ptr=(UINT8*)(initrd_p + *((UINT64*)&in->data.small.inlinedata) * ss);
|
ret.ptr=(UINT8*)(initrd_p + *(sb->flags&FSZ_SB_FLAG_BIGINODE?
|
||||||
|
(UINT64*)&in->data.big.inlinedata : (UINT64*)&in->data.small.inlinedata) * ss);
|
||||||
break;
|
break;
|
||||||
case FSZ_IN_FLAG_DIRECT:
|
case FSZ_IN_FLAG_DIRECT:
|
||||||
// direct data
|
// direct data
|
||||||
|
|
Loading…
Add table
Reference in a new issue