Fix: compatibility, kernel stack, + docs
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
- Writing programs for BlankOS
|
||||
- Changing the TTY font
|
||||
- Changing the initial ramdisk content
|
||||
- Changing the framebuffer resolution
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -120,3 +121,19 @@ The system loads an initial ramdisk as a simple TAR file located in `iso/boot/in
|
||||
You can add, delete, or modify this file's contents by doing that in the `src/initrd` folder. Anything in that folder will be added to the initial ramdisk and will therefore be loaded into the system.
|
||||
|
||||
The ramdisk gets loaded as a GRUB2 module.
|
||||
|
||||
## Changing the framebuffer resolution
|
||||
|
||||
Locate the framebuffer request tag from the Multiboot2 header in `src/kernel/loader.s`. It should look like this:
|
||||
|
||||
```
|
||||
align 8
|
||||
dw 5 ; 2
|
||||
dw 0 ; 2
|
||||
dd 20 ; 4
|
||||
dd 1920 ; 4
|
||||
dd 1080 ; 4
|
||||
dd 32 ; 4
|
||||
```
|
||||
|
||||
Change the `1920` and `1080` values with the resolution you want, according to your screen. Be aware that this might break some programs that rely on the hardcoded Full HD framebuffer value (1920x1080x32). You can also try switching the value under that,`32`, but it will break the display because the kernel is made for 32bpp.
|
||||
|
||||
1
grub.cfg
1
grub.cfg
@@ -1,6 +1,5 @@
|
||||
menuentry "Blank OS" {
|
||||
insmod all_video
|
||||
set gfxpayload=1024x768x32
|
||||
multiboot2 /boot/kernel.elf
|
||||
module2 /boot/initrd.tar
|
||||
boot
|
||||
|
||||
2
link.ld
2
link.ld
@@ -3,7 +3,7 @@ ENTRY(loader)
|
||||
SECTIONS {
|
||||
/* Address to load at; 2MB */
|
||||
|
||||
/*. = 2M;*/
|
||||
. = 2M;
|
||||
|
||||
.multiboot_header ALIGN(4K) : {
|
||||
*(.multiboot_header)
|
||||
|
||||
2
makefile
2
makefile
@@ -1,5 +1,5 @@
|
||||
CC = i386-elf-7.5.0-Linux-x86_64/bin/i386-elf-gcc
|
||||
CFLAGS = -ffreestanding -g -Wall -Wextra -Wno-builtin-declaration-mismatch -c -I src/
|
||||
CFLAGS = -ffreestanding -g -Wall -Wextra -Wno-builtin-declaration-mismatch -mno-sse -mno-mmx -mno-avx -march=i386 -c -I src/
|
||||
LDFLAGS = -T link.ld -melf_i386
|
||||
AS = nasm
|
||||
ASFLAGS = -f elf
|
||||
|
||||
@@ -51,6 +51,7 @@ KERNEL_STACK_SIZE equ 4096
|
||||
extern kmain
|
||||
|
||||
loader:
|
||||
mov esp, kernel_stack + KERNEL_STACK_SIZE
|
||||
cli
|
||||
push ebx
|
||||
call kmain
|
||||
@@ -211,6 +212,6 @@ irq_common_stub:
|
||||
|
||||
section .bss
|
||||
align 4
|
||||
kernel_stack:
|
||||
|
||||
resb KERNEL_STACK_SIZE
|
||||
mov esp, kernel_stack + KERNEL_STACK_SIZE
|
||||
kernel_stack:
|
||||
|
||||
Reference in New Issue
Block a user