1
0
Fork 0
mirror of https://gitlab.com/bztsrc/bootboot.git synced 2023-02-13 20:54:32 -05:00

Minor fixes and typos

This commit is contained in:
bzt 2019-02-10 20:34:39 +01:00
parent a42fd37e81
commit c74e6d49f9
9 changed files with 19 additions and 15 deletions

View file

@ -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/bootboot.efi) (94k), [bootboot.rom](https://gitlab.com/bztsrc/bootboot/raw/master/bootboot.rom) (93k) [bootboot.efi](https://gitlab.com/bztsrc/bootboot/raw/master/bootboot.efi) (94k), [bootboot.rom](https://gitlab.com/bztsrc/bootboot/raw/master/bootboot.rom) (94k)
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).
@ -241,7 +241,7 @@ OS developers, specially for those who want to write their own file systems.
The reference implementations support [cpio](https://en.wikipedia.org/wiki/Cpio) (all hpodc, newc and crc variants), The reference implementations support [cpio](https://en.wikipedia.org/wiki/Cpio) (all hpodc, newc and crc variants),
[ustar](https://en.wikipedia.org/wiki/Tar_(computing)), osdev.org's [SFS](http://wiki.osdev.org/SFS), [ustar](https://en.wikipedia.org/wiki/Tar_(computing)), osdev.org's [SFS](http://wiki.osdev.org/SFS),
[James Molloy's initrd](http://www.jamesmolloy.co.uk/tutorial_html/8.-The%20VFS%20and%20the%20initrd.html) [James Molloy's initrd](http://www.jamesmolloy.co.uk/tutorial_html/8.-The%20VFS%20and%20the%20initrd.html)
format and OS/Z's native [FS/Z](https://gitlab.com/bztsrc/osz/blob/master/etc/include/sys/fsZ.h) (with encryption support too). format and OS/Z's native [FS/Z](https://gitlab.com/bztsrc/osz/blob/master/include/sys/fsZ.h) (with encryption support too).
Gzip compressed initrds also supported to save disk space and fasten up load time (not recommended on RPi3). Gzip compressed initrds also supported to save disk space and fasten up load time (not recommended on RPi3).
Example kernel Example kernel

View file

@ -44,7 +44,7 @@
/* get BOOTBOOT structure */ /* get BOOTBOOT structure */
#include "../bootboot.h" #include "../bootboot.h"
// comment out this include if you don't want FS/Z support // comment out this include if you don't want FS/Z support
#include "../../osZ/etc/include/sys/fsZ.h" #include "../../osZ/include/sys/fsZ.h"
/* aligned buffers */ /* aligned buffers */

BIN
boot.bin

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -109,7 +109,7 @@ bootboot_record:
mov byte [lbapacket.size], 16 mov byte [lbapacket.size], 16
mov byte [lbapacket.addr0+1], 08h ;to address 800h mov byte [lbapacket.addr0+1], 08h ;to address 800h
;check for lba presistance - floppy not supported any more ;check for lba presistance - floppy not supported any more
;we use pendrive as removable media for a long time ;we use USB sticks as removable media for a long time
cmp dl, byte 80h cmp dl, byte 80h
jl .nolba jl .nolba
.notfloppy: mov ah, byte 41h .notfloppy: mov ah, byte 41h
@ -144,7 +144,7 @@ bootboot_record:
pop di pop di
jc @f jc @f
;some buggy BIOSes (like bochs') fail to set carry flag and ax properly ;some buggy BIOSes (like bochs') fail to set carry flag and ax properly
cmp byte [si+2], 0h cmp byte [spc_packet+2], 0h
jz @f jz @f
;lba=lba/4 ;lba=lba/4
clc clc

View file

@ -201,8 +201,9 @@ MB_FLAGS equ 010001h
;----------------Multiboot stub----------------- ;----------------Multiboot stub-----------------
USE32 USE32
multiboot_start: multiboot_start:
cld
cli cli
cld
lgdt [GDT_value]
;clear drive code, initrd ptr and environment ;clear drive code, initrd ptr and environment
xor edx, edx xor edx, edx
mov edi, 9000h mov edi, 9000h
@ -243,8 +244,6 @@ multiboot_start:
mov CR0, eax mov CR0, eax
xor ax, ax xor ax, ax
mov ds, ax ;load segment registers mov ds, ax ;load segment registers
mov es, ax
mov ss, ax
jmp 0:realmode_start jmp 0:realmode_start
;-----------realmode-protmode stub------------- ;-----------realmode-protmode stub-------------
@ -252,6 +251,9 @@ realmode_start:
cli cli
cld cld
mov sp, 7C00h mov sp, 7C00h
xor ax, ax
mov es, ax
mov ss, ax
;relocate ourself from ROM to RAM if necessary ;relocate ourself from ROM to RAM if necessary
call .getaddr call .getaddr
.getaddr: pop si .getaddr: pop si
@ -261,8 +263,6 @@ realmode_start:
cmp si, .getaddr cmp si, .getaddr
je .noreloc je .noreloc
.reloc: mov ds, ax .reloc: mov ds, ax
xor ax, ax
mov es, ax
mov di, loader mov di, loader
sub si, .getaddr-loader sub si, .getaddr-loader
mov cx, (loader_end-loader)/2 mov cx, (loader_end-loader)/2
@ -341,9 +341,7 @@ realmode_start:
mov eax, 80000000h mov eax, 80000000h
mov ebp, eax mov ebp, eax
inc ebp inc ebp
push bx
cpuid cpuid
pop bx
cmp eax, ebp cmp eax, ebp
jb .cpuerror jb .cpuerror
mov eax, ebp mov eax, ebp
@ -506,7 +504,7 @@ getmemmap:
cmp dword [di], 0 cmp dword [di], 0
jnz .notfirst jnz .notfirst
; "allocate" memory for loader ; "allocate" memory for loader
mov eax, 15000h mov eax, 14000h
add dword [di], eax add dword [di], eax
sub dword [di+8], eax sub dword [di+8], eax
;convert E820 memory type to BOOTBOOT memory type ;convert E820 memory type to BOOTBOOT memory type
@ -1871,7 +1869,13 @@ end if
inc word [bootboot.numcores] inc word [bootboot.numcores]
mov ax, word [bootboot.bspid] mov ax, word [bootboot.bspid]
mov word [lapic_ids], ax mov word [lapic_ids], ax
@@: @@: ; remove core stacks from memory map
xor eax, eax
mov ax, word [bootboot.numcores]
shl eax, 10
mov edi, bootboot.mmap
add dword [edi], eax
sub dword [edi+8], eax
; ------- set video resolution ------- ; ------- set video resolution -------
prot_realmode prot_realmode

View file

@ -49,7 +49,7 @@
#include "../bootboot.h" #include "../bootboot.h"
#include "tinf.h" #include "tinf.h"
// comment out this include if you don't want FS/Z support // comment out this include if you don't want FS/Z support
#include "../../osZ/etc/include/sys/fsZ.h" #include "../../osZ/include/sys/fsZ.h"
/*** ELF64 defines and structs ***/ /*** ELF64 defines and structs ***/
#define ELFMAG "\177ELF" #define ELFMAG "\177ELF"