Code: Select all
void Start_Kernel(void){
int *addr=(int*)0xffff800000a00000;
for(int i=0;i<1440*20;i++){
*addr=0x0032FA00;
addr+=1;
}
while(1);
}
According to my debug, I found that both qemu and Bochs are able to reach the while(1) successfully, but there're nothing printed on the qemu, while it runs correctly on Bochs. I now doubt it is the problem of SVGA mode(since I set SVGA into VESA VBE), and I wonder how can I let qemu support VESA VBE mode.
Here is the code I use to setup VESA VBE mode:
Code: Select all
mov ax,4F02h
mov bx,4180h
int 10h
And here is the command I use to load os in to qemu:
Code: Select all
qemu-system-x86_64 -s -S -fda a.img
Code: Select all
###############################################################
# Configuration file for Bochs
###############################################################
# how much memory the emulated machine will have
megs: 32
# filename of ROM images
romimage: file=/usr/share/bochs/BIOS-bochs-latest
vgaromimage: file=/usr/share/vgabios/vgabios.bin
# what disk images will be used
floppya: 1_44=a.img, status=inserted
# hard disk
#ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
# !! Remember to change these if the hd img is changed:
# 1. include/sys/config.h::MINOR_BOOT
# 2. boot/include/load.inc::ROOT_BASE
# 3. Makefile::HD
# 4. commands/Makefile::HD
#ata0-master: type=disk, path="80m.img", mode=flat, cylinders=162, heads=16, spt=63
# choose the boot disk.
boot: floppy
# where do we send log messages?
log: bochsout.txt
# disable the mouse
mouse: enabled=0
# enable key mapping, using US layout as default.
keyboard: keymap=/usr/share/bochs/keymaps/x11-pc-us.map