Making stuff work again

This commit is contained in:
Jarkko Toivanen 2023-06-22 02:13:20 +03:00
parent 086eba4ea4
commit e472492ee3
Signed by: jt
GPG key ID: 9151B109B73ECAD5
2 changed files with 57 additions and 56 deletions

View file

@ -6,12 +6,13 @@ build/start32.o: build/ src/start32.asm
fasm src/start32.asm build/start32.o fasm src/start32.asm build/start32.o
build/kernel-i386.elf: build/start32.o build/kernel-i386.elf: build/start32.o
tcc -m32 -nostdlib -Wl,-Ttext,0x100000 -o build/kernel-i386.elf src/*.c build/start32.o tcc -m32 -nostdlib -Wl,-Ttext,0x100000 -o build/kernel-i386.elf src/*.c build/start32.o
image: build/kernel-i386.elf mount
cp build/kernel-i386.elf mnt/
sync
qemu-multiboot: build/kernel-i386.elf qemu-multiboot: build/kernel-i386.elf
qemu-system-i386 -kernel build/kernel-i386.elf -serial stdio qemu-system-i386 -kernel build/kernel-i386.elf -serial stdio
qemu-image: build/kernel-i386.elf mount qemu-image: image
cp build/kernel-i386.elf mnt/
sync
qemu-system-i386 koalemos.img -serial stdio qemu-system-i386 koalemos.img -serial stdio
mount: koalemos.img mnt/ mount: koalemos.img mnt/

View file

@ -29,9 +29,6 @@ void kmain (unsigned int mbootmagick, multiboot_info_t* mbootinfo) {
serial_write_string("\nMultiboot flags: "); serial_write_string("\nMultiboot flags: ");
serial_write_string(itoa(mbootinfo->flags, 2)); serial_write_string(itoa(mbootinfo->flags, 2));
serial_write_string("\nMultiboot flags: ");
serial_write_string(itoa(mbootinfo->flags, 2));
// Check videomode // Check videomode
if (mbootinfo->flags & MULTIBOOT_INFO_VBE_INFO) { if (mbootinfo->flags & MULTIBOOT_INFO_VBE_INFO) {
serial_write_string("\nVBE Mode: 0x"); serial_write_string("\nVBE Mode: 0x");
@ -63,13 +60,16 @@ void kmain (unsigned int mbootmagick, multiboot_info_t* mbootinfo) {
serial_write_string(itoa(mbootinfo->framebuffer_blue_field_position, 10)); serial_write_string(itoa(mbootinfo->framebuffer_blue_field_position, 10));
initfb(mbootinfo->framebuffer_addr, mbootinfo->framebuffer_width, mbootinfo->framebuffer_height, mbootinfo->framebuffer_bpp, mbootinfo->framebuffer_pitch, mbootinfo->framebuffer_red_field_position, mbootinfo->framebuffer_green_field_position, mbootinfo->framebuffer_blue_field_position); initfb(mbootinfo->framebuffer_addr, mbootinfo->framebuffer_width, mbootinfo->framebuffer_height, mbootinfo->framebuffer_bpp, mbootinfo->framebuffer_pitch, mbootinfo->framebuffer_red_field_position, mbootinfo->framebuffer_green_field_position, mbootinfo->framebuffer_blue_field_position);
int x, y, i;
int x, y; unsigned char c = 0;
for (y=0; y<mbootinfo->framebuffer_height;y++) { for(;;) {
for (x=0; x<mbootinfo->framebuffer_width;x++) { for(y=0;y<768;y++) {
putpixel(x, y, 0, 255*x/mbootinfo->framebuffer_width, 255*y/mbootinfo->framebuffer_height, 0xff); for(x=0;x<1024;x++) {
putpixel(x, y, c, c, c, 0xff);
} }
} }
c+=4;
}
serial_write_string("\nExecution finished, halting..."); serial_write_string("\nExecution finished, halting...");
} }