diff --git a/aarch64-rpi/boot.S b/aarch64-rpi/boot.S index 0782c82..ab15750 100644 --- a/aarch64-rpi/boot.S +++ b/aarch64-rpi/boot.S @@ -1,7 +1,7 @@ /* * aarch64-rpi/boot.S * - * Copyright (C) 2017 bzt (bztsrc@gitlab) + * Copyright (C) 2017 - 2020 bzt (bztsrc@gitlab) * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation diff --git a/aarch64-rpi/bootboot.c b/aarch64-rpi/bootboot.c index 5470b22..c286d9c 100644 --- a/aarch64-rpi/bootboot.c +++ b/aarch64-rpi/bootboot.c @@ -1,7 +1,7 @@ /* * aarch64-rpi/bootboot.c * - * Copyright (C) 2017 - 2019 bzt (bztsrc@gitlab) + * Copyright (C) 2017 - 2020 bzt (bztsrc@gitlab) * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation diff --git a/aarch64-rpi/fs.h b/aarch64-rpi/fs.h index 4622ce1..706ee65 100644 --- a/aarch64-rpi/fs.h +++ b/aarch64-rpi/fs.h @@ -1,7 +1,7 @@ /* * aarch64-rpi/fs.h * - * Copyright (C) 2017 bzt (bztsrc@gitlab) + * Copyright (C) 2017 - 2020 bzt (bztsrc@gitlab) * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation diff --git a/aarch64-rpi/mkboot.c b/aarch64-rpi/mkboot.c index 237725a..63488c1 100644 --- a/aarch64-rpi/mkboot.c +++ b/aarch64-rpi/mkboot.c @@ -1,7 +1,7 @@ /* * aarch64-rpi/mkboot.c * - * Copyright (C) 2017 bzt (bztsrc@gitlab) + * Copyright (C) 2017 - 2020 bzt (bztsrc@gitlab) * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -25,7 +25,7 @@ * * This file is part of the BOOTBOOT Protocol package. * @brief Little tool to create a RPi compatible MBR for ESP - * + * */ #include diff --git a/bootboot.bin b/bootboot.bin index 9315afb..ab554cd 100644 Binary files a/bootboot.bin and b/bootboot.bin differ diff --git a/bootboot.efi b/bootboot.efi index 382ae0e..cb2d52d 100755 Binary files a/bootboot.efi and b/bootboot.efi differ diff --git a/bootboot.h b/bootboot.h index 14f2beb..912d6c1 100644 --- a/bootboot.h +++ b/bootboot.h @@ -1,7 +1,7 @@ /* * bootboot.h * - * Copyright (C) 2017 - 2019 bzt (bztsrc@gitlab) + * Copyright (C) 2017 - 2020 bzt (bztsrc@gitlab) * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation diff --git a/bootboot.img b/bootboot.img index 93c040a..7b9dbd0 100755 Binary files a/bootboot.img and b/bootboot.img differ diff --git a/bootboot.rom b/bootboot.rom index e645dc4..f3ef042 100644 Binary files a/bootboot.rom and b/bootboot.rom differ diff --git a/images/Makefile b/images/Makefile index 82adf6a..c2a6c73 100644 --- a/images/Makefile +++ b/images/Makefile @@ -3,8 +3,8 @@ DISKSIZE=128 # boot partition size in kilobytes (16M) BOOTSIZE=16384 # platform, either x86 or rpi -PLATFORM=x86 -#PLATFORM=rpi +#PLATFORM=x86 +PLATFORM=rpi # the path to OVMF.fd (for testing with EFI) OVMF=/usr/share/qemu/bios-TianoCoreEFI.bin diff --git a/images/disk-rpi.img.gz b/images/disk-rpi.img.gz index 8ade348..94ee35d 100644 Binary files a/images/disk-rpi.img.gz and b/images/disk-rpi.img.gz differ diff --git a/images/disk-x86.img.gz b/images/disk-x86.img.gz index 0b2e088..69bdae7 100644 Binary files a/images/disk-x86.img.gz and b/images/disk-x86.img.gz differ diff --git a/images/mkimg.c b/images/mkimg.c index 1c8bb4c..5f09b8a 100644 --- a/images/mkimg.c +++ b/images/mkimg.c @@ -1,7 +1,7 @@ /* * images/mkimg.c * - * Copyright (C) 2017 - 2019 bzt (bztsrc@gitlab) + * Copyright (C) 2017 - 2020 bzt (bztsrc@gitlab) * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation diff --git a/mykernel/Makefile b/mykernel/Makefile index 0e49399..e32790c 100644 --- a/mykernel/Makefile +++ b/mykernel/Makefile @@ -1,7 +1,7 @@ # # mykernel/Makefile # -# Copyright (C) 2017 bzt (bztsrc@gitlab) +# Copyright (C) 2017 - 2020 bzt (bztsrc@gitlab) # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation diff --git a/mykernel/kernel.c b/mykernel/kernel.c index e001abb..1afce9f 100644 --- a/mykernel/kernel.c +++ b/mykernel/kernel.c @@ -1,7 +1,7 @@ /* * mykernel/kernel.c * - * Copyright (C) 2017 bzt (bztsrc@gitlab) + * Copyright (C) 2017 - 2020 bzt (bztsrc@gitlab) * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation diff --git a/mykernel/link.ld b/mykernel/link.ld index 34adcff..be98d97 100644 --- a/mykernel/link.ld +++ b/mykernel/link.ld @@ -1,7 +1,7 @@ /* * mykernel/link.ld * - * Copyright (C) 2017 bzt (bztsrc@gitlab) + * Copyright (C) 2017 - 2020 bzt (bztsrc@gitlab) * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation diff --git a/x86_64-bios/boot.asm b/x86_64-bios/boot.asm index 5d0b034..a0b0ad7 100644 --- a/x86_64-bios/boot.asm +++ b/x86_64-bios/boot.asm @@ -1,7 +1,7 @@ ;* ;* x86_64-bios/boot.asm ;* -;* Copyright (C) 2017 bzt (bztsrc@gitlab) +;* Copyright (C) 2017 - 2020 bzt (bztsrc@gitlab) ;* ;* Permission is hereby granted, free of charge, to any person ;* obtaining a copy of this software and associated documentation diff --git a/x86_64-bios/bootboot.asm b/x86_64-bios/bootboot.asm index c8ad8f9..60f2d6d 100644 --- a/x86_64-bios/bootboot.asm +++ b/x86_64-bios/bootboot.asm @@ -1,7 +1,7 @@ ;* ;* x86_64-bios/bootboot.asm ;* -;* Copyright (C) 2017 - 2019 bzt (bztsrc@gitlab) +;* Copyright (C) 2017 - 2020 bzt (bztsrc@gitlab) ;* ;* Permission is hereby granted, free of charge, to any person ;* obtaining a copy of this software and associated documentation @@ -237,7 +237,10 @@ multiboot_start: mov esi, dword [eax+16] mov ecx, 1024 repnz movsd -@@: jmp CODE_BOOT:.real ;load 16 bit mode segment into cs +@@: mov ax, DATA_BOOT + mov ds, ax + mov es, ax + jmp CODE_BOOT:.real ;load 16 bit mode segment into cs USE16 .real: mov eax, CR0 and eax, 07FFFFFFEh ;switching back to real mode @@ -2467,6 +2470,8 @@ end if GDT_table: dd 0, 0 ;null descriptor DATA_PROT = $-GDT_table dd 0000FFFFh,008F9200h ;flat ds +DATA_BOOT = $-GDT_table + dd 0000FFFFh,00009200h ;16 bit legacy real mode ds CODE_BOOT = $-GDT_table dd 0000FFFFh,00009800h ;16 bit legacy real mode cs CODE_PROT = $-GDT_table diff --git a/x86_64-bios/bootboot.inc b/x86_64-bios/bootboot.inc index 3d735db..31e3c75 100644 --- a/x86_64-bios/bootboot.inc +++ b/x86_64-bios/bootboot.inc @@ -1,7 +1,7 @@ ;* ;* x86_64-bios/bootboot.inc ;* -;* Copyright (C) 2017 - 2019 bzt (bztsrc@gitlab) +;* Copyright (C) 2017 - 2020 bzt (bztsrc@gitlab) ;* ;* Permission is hereby granted, free of charge, to any person ;* obtaining a copy of this software and associated documentation diff --git a/x86_64-bios/fs.inc b/x86_64-bios/fs.inc index 2d8b06b..50f477d 100644 --- a/x86_64-bios/fs.inc +++ b/x86_64-bios/fs.inc @@ -1,7 +1,7 @@ ;* ;* x86_64-bios/fs.inc ;* -;* Copyright (C) 2017 bzt (bztsrc@gitlab) +;* Copyright (C) 2017 - 2020 bzt (bztsrc@gitlab) ;* ;* Permission is hereby granted, free of charge, to any person ;* obtaining a copy of this software and associated documentation diff --git a/x86_64-bios/initrd.asm b/x86_64-bios/initrd.asm deleted file mode 100644 index cf36414..0000000 --- a/x86_64-bios/initrd.asm +++ /dev/null @@ -1,62 +0,0 @@ -;* -;* x86_64-bios/initrd.asm -;* -;* Copyright (C) 2017 bzt (bztsrc@gitlab) -;* -;* Permission is hereby granted, free of charge, to any person -;* obtaining a copy of this software and associated documentation -;* files (the "Software"), to deal in the Software without -;* restriction, including without limitation the rights to use, copy, -;* modify, merge, publish, distribute, sublicense, and/or sell copies -;* of the Software, and to permit persons to whom the Software is -;* furnished to do so, subject to the following conditions: -;* -;* The above copyright notice and this permission notice shall be -;* included in all copies or substantial portions of the Software. -;* -;* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -;* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -;* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -;* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -;* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -;* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -;* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -;* DEALINGS IN THE SOFTWARE. -;* -;* This file is part of the BOOTBOOT Protocol package. -;* @brief Option ROM for initrd. mkfs utility also can do this. -;* -;* This may seem odd, but works with BIOS (up to 96k gzipped -;* initrd), and makes much more sense on EFI, where Option ROMs -;* can be 16M in size. -;* - -;------------header------------ - USE16 - ORG 0h -rom: db 55h,0AAh ;ROM magic - db (rom_end-rom)/512 ;size in 512 blocks -.executor: xor ax, ax ;entry point - retf -.checksum: dw 0 ;checksum -.name: db "INITRD" - db 0,0 - dd initrd_end-initrd, 0 - db 0,0 -.pnpptr: dw 0 -.flags: dd 0 -;------------data------------ -initrd: - file "../../bin/ESP/BOOTBOOT/INITRD" -initrd_end: -;-----------padding to be multiple of 512---------- - db (511-($-rom+511) mod 512) dup 0 -rom_end: - -;-----------BIOS checksum------------ -chksum = 0 -repeat $-rom - load b byte from (rom+%-1) - chksum = (chksum + b) mod 100h -end repeat -store byte (100h-chksum) at (rom.checksum) diff --git a/x86_64-bios/mkboot.c b/x86_64-bios/mkboot.c index 38466fc..38882cd 100644 --- a/x86_64-bios/mkboot.c +++ b/x86_64-bios/mkboot.c @@ -1,7 +1,7 @@ /* * x86_64-bios/mkboot.c * - * Copyright (C) 2017 bzt (bztsrc@gitlab) + * Copyright (C) 2017 - 2020 bzt (bztsrc@gitlab) * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation diff --git a/x86_64-bios/tinf.inc b/x86_64-bios/tinf.inc index fc22bef..e28ee36 100644 --- a/x86_64-bios/tinf.inc +++ b/x86_64-bios/tinf.inc @@ -1,7 +1,7 @@ ;* ;* x86_64-bios/tinf.inc ;* -;* Copyright (C) 2017 bzt (bztsrc@gitlab) +;* Copyright (C) 2017 - 2020 bzt (bztsrc@gitlab) ;* ;* Permission is hereby granted, free of charge, to any person ;* obtaining a copy of this software and associated documentation diff --git a/x86_64-efi/bootboot.c b/x86_64-efi/bootboot.c index c6df8f7..9d99a3f 100644 --- a/x86_64-efi/bootboot.c +++ b/x86_64-efi/bootboot.c @@ -1,7 +1,7 @@ /* * x86_64-efi/bootboot.c * - * Copyright (C) 2017 - 2019 bzt (bztsrc@gitlab) + * Copyright (C) 2017 - 2020 bzt (bztsrc@gitlab) * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation diff --git a/x86_64-efi/fs.h b/x86_64-efi/fs.h index 9fb5d18..fd44d94 100644 --- a/x86_64-efi/fs.h +++ b/x86_64-efi/fs.h @@ -1,7 +1,7 @@ /* * x86_64-efi/fs.h * - * Copyright (C) 2017 bzt (bztsrc@gitlab) + * Copyright (C) 2017 - 2020 bzt (bztsrc@gitlab) * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation