can now modify frame buffer

This commit is contained in:
aramya 2021-09-29 04:11:53 +01:00
parent 45016d0db7
commit 530f9581b3
4 changed files with 22 additions and 10 deletions

View File

@ -1,6 +1,6 @@
PPC=powerpc-linux-gnu
DISK.APM: kernel.elf bootinfo.txt kpartx.sh
dd bs=8M count=2 if=/dev/zero of=DISK.APM
dd bs=512K count=2 if=/dev/zero of=DISK.APM
parted DISK.APM --script mklabel mac mkpart primary hfs+ 32.8KB 100%
sudo chmod +x kpartx.sh
sudo ./kpartx.sh
@ -14,11 +14,17 @@ bootinfo.txt: load.fs
echo "<chrp-boot><boot-script>" >> bootinfo.txt
cat load.fs >> bootinfo.txt
echo "</boot-script></chrp-boot>" >> bootinfo.txt
kernel.elf: boot.elf boot1.elf
kernel.elf: boot.elf boot1.elf
$(PPC)-ld -Ttext=0x200000 boot.elf boot1.elf -o kernel.elf
boot1.elf: boot.c
$(PPC)-gcc -c boot.c -o boot1.elf
boot.elf: boot.S
$(PPC)-as -c boot.S -o boot.elf
clean:
rm DISK.APM *elf *txt
rm DISK.APM *elf *txt
run:
qemu-system-ppc DISK.APM
debug:
qemu-system-ppc DISK.APM -d in_asm
all:
make clean && make && make run

2
boot.S
View File

@ -1,4 +1,4 @@
.globl _start
_start:
addi 1,1,1
b begin
b begin

9
boot.c
View File

@ -1,4 +1,11 @@
void begin(void)
{
for(;;){};
unsigned char* addr = 0x7FFFFFFF;
unsigned char* noise = 0xFFEE0000;
while (addr < 0x80500000){
*addr = *noise;
addr++;
noise++;
}
for(;;);
}

View File

@ -1,7 +1,6 @@
12
12
*
.
." Booting through OpenFirmware..." cr
." Loading: hd:,\boot\kernel.elf" cr
frame-buffer-adr
.
: rep dup 0 do i . loop ;
500 rep
boot hd:,\boot\kernel.elf