diff --git a/Makefile b/Makefile index 2aed649..7dc764e 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,4 @@ +MACHINE=mac99 PPC=powerpc-linux-gnu QEMU=qemu-system-ppc DISK.APM: kernel.elf bootinfo.txt scripts/kpartx.sh @@ -24,8 +25,8 @@ start.elf: entry/start.s clean: rm *.APM *elf *txt run: - $(QEMU) *.APM -g 1024x768x32 + $(QEMU) *.APM -g 1280x768x32 -machine $(MACHINE) debug: - $(QEMU) *.APM -d in_asm -g 1024x768x32 + $(QEMU) *.APM -d in_asm -g 1280x768x32 -machine $(MACHINE) all: make clean && make && make run diff --git a/entry/boot.c b/entry/boot.c index 18ee183..24f2b6d 100644 --- a/entry/boot.c +++ b/entry/boot.c @@ -1,16 +1,18 @@ -#define beige 0xBE -#define mac99 0x5A -#define __VRAM__BEIGE 0x80000000 -#define __VRAM__MAC99 0x81000000 -#define __BIOS__BEIGE 0xFFC00000 -#define __BIOS__MAC99 0xFFF00000 +#define beige 0xBE +#define mac99 0x5A +#define __VRAM__BEIGE 0x80000000 +#define __BIOS__BEIGE 0xFFC00000 -unsigned char IO_TYPE; +#define __VRAM__MAC99 0x81000000 +#define __BIOS__MAC99 0XFFF00000 +#define __USB_KEYBOARD__MAC99 0x80080038 +#define __USB_MOUSE__MAC99 0x8008003C + +unsigned char IO_TYPE; unsigned char* p_vram; unsigned char* p_bios; - void get_io_type(void) { if (*(unsigned char*)__VRAM__BEIGE == beige) IO_TYPE = beige; @@ -21,9 +23,7 @@ void init(void) { if (IO_TYPE == beige) { - p_vram = __VRAM__BEIGE; - p_bios = __BIOS__BEIGE; - + for(;;); // unsupported yet. } else if (IO_TYPE == mac99) { @@ -36,29 +36,23 @@ void main(void) { get_io_type(); init(); - clearscreen(0xAA,0xBB); + clearscreen(100,85,100, 0x100000); for(;;); } -void clearscreen(unsigned char a, unsigned char b) +void clearscreen(unsigned char a, unsigned char b, unsigned char c, int n) { init(); - for (unsigned int i = 0; i<0x100000; i++) + for (unsigned int i = 0; i