Real mode problem
Real mode problem
Hi!
I use linux and code my own os. I have writen a simple kernel and need to load it!
I have trying many many many many boot loaders but nobody of them work! I have qemu, bochs dont work here. Must i take boot.bin and kernel.bin in a img fil so then load it whit qemu, or use an other boot loader?
I use linux and code my own os. I have writen a simple kernel and need to load it!
I have trying many many many many boot loaders but nobody of them work! I have qemu, bochs dont work here. Must i take boot.bin and kernel.bin in a img fil so then load it whit qemu, or use an other boot loader?
Sorry my english, i'm from norway..
I write my own os now, DanOS. Website coming soon!
I write my own os now, DanOS. Website coming soon!
check the signature, awesome tutorials.
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
http://catb.org/~esr/faqs/smart-questions.htmlNow i just get errors in bochs..
Ok, here is my bochs log:
Can someone see if something is wrong?
Code: Select all
00000000000i[ ] Bochs x86 Emulator 2.3
00000000000i[ ] Build from CVS snapshot on August 27, 2006
00000000000i[ ] System configuration
00000000000i[ ] processors: 1 (cores=1, HT threads=1)
00000000000i[ ] A20 line support: yes
00000000000i[ ] APIC support: yes
00000000000i[ ] CPU configuration
00000000000i[ ] level: 6
00000000000i[ ] paging support: yes, tlb enabled: yes
00000000000i[ ] SMP support: no
00000000000i[ ] FPU support: yes
00000000000i[ ] MMX support: yes
00000000000i[ ] SSE support: 4
00000000000i[ ] v8086 mode support: yes
00000000000i[ ] VME support: yes
00000000000i[ ] 3dnow! support: yes
00000000000i[ ] PAE support: yes
00000000000i[ ] PGE support: yes
00000000000i[ ] PSE support: yes
00000000000i[ ] x86-64 support: yes
00000000000i[ ] SEP support: yes
00000000000i[ ] Optimization configuration
00000000000i[ ] Guest2HostTLB support: yes
00000000000i[ ] RepeatSpeedups support: yes
00000000000i[ ] Icache support: yes
00000000000i[ ] Host Asm support: yes
00000000000i[ ] Fast function calls: yes
00000000000i[ ] Devices configuration
00000000000i[ ] NE2000 support: yes
00000000000i[ ] PCI support: yes
00000000000i[ ] SB16 support: yes
00000000000i[ ] USB support: yes
00000000000i[ ] VGA extension support: vbe
00000000000i[MEM0 ] allocated memory at 0xb5b4d008. after alignment, vector=0xb5b4e000
00000000000i[MEM0 ] 32,00MB
00000000000i[MEM0 ] rom at 0xf0000/65536 ('/usr/share/bochs/BIOS-bochs-latest')
00000000000p[MEM0 ] >>PANIC<< ROM: couldn't open ROM image file '/usr/share/bochs/VGABIOS-elpin-2.40'.
00000000000i[APIC?] set APIC ID to 0
00000000000i[APIC0] 80686
00000000000i[APIC0] local apic in CPU apicid=00 initializing
00000000000i[VTIME] using 'realtime pit' synchronization method
00000000000i[ ] lt_dlhandle is 0x82ece30
00000000000i[PLGIN] loaded plugin libbx_unmapped.la
00000000000i[ ] lt_dlhandle is 0x82ed9e8
00000000000i[PLGIN] loaded plugin libbx_biosdev.la
00000000000i[ ] lt_dlhandle is 0x82ee318
00000000000i[PLGIN] loaded plugin libbx_cmos.la
00000000000i[ ] lt_dlhandle is 0x82ee8e8
00000000000i[PLGIN] loaded plugin libbx_dma.la
00000000000i[ ] lt_dlhandle is 0x82ee390
00000000000i[PLGIN] loaded plugin libbx_pic.la
00000000000i[ ] lt_dlhandle is 0x82ef048
00000000000i[PLGIN] loaded plugin libbx_vga.la
00000000000i[ ] lt_dlhandle is 0x82ef8a0
00000000000i[PLGIN] loaded plugin libbx_floppy.la
00000000000i[ ] lt_dlhandle is 0x82f00e8
00000000000i[PLGIN] loaded plugin libbx_harddrv.la
00000000000i[ ] lt_dlhandle is 0x8301cb8
00000000000i[PLGIN] loaded plugin libbx_keyboard.la
00000000000i[ ] lt_dlhandle is 0x8301e50
00000000000i[PLGIN] loaded plugin libbx_serial.la
00000000000i[ ] lt_dlhandle is 0x8302310
00000000000i[PLGIN] loaded plugin libbx_parallel.la
00000000000i[ ] lt_dlhandle is 0x83033b0
00000000000i[PLGIN] loaded plugin libbx_extfpuirq.la
00000000000i[ ] lt_dlhandle is 0x8303888
00000000000i[PLGIN] loaded plugin libbx_gameport.la
00000000000i[ ] lt_dlhandle is 0x8303da0
00000000000i[PLGIN] loaded plugin libbx_speaker.la
00000000000i[ ] lt_dlhandle is 0x8304290
00000000000i[PLGIN] loaded plugin libbx_pci.la
00000000000i[ ] lt_dlhandle is 0x8304a20
00000000000i[PLGIN] loaded plugin libbx_pci2isa.la
00000000000i[ ] lt_dlhandle is 0x8305008
00000000000i[PLGIN] loaded plugin libbx_pci_ide.la
00000000000i[IOAP ] initializing I/O APIC
00000000000i[IOAP ] set APIC ID to 1
00000000000i[MEM0 ] Register memory access handlers: fec00000-fec00fff
00000000000i[CMOS ] Using local time for initial clock
00000000000i[CMOS ] Setting initial clock to: Thu Mar 20 00:56:40 2008 (time0=1205971000)
00000000000i[DMA ] channel 4 used by cascade
00000000000i[DMA ] channel 2 used by Floppy Drive
Sorry my english, i'm from norway..
I write my own os now, DanOS. Website coming soon!
I write my own os now, DanOS. Website coming soon!
Are you getting errors, or are you just checking?
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc
please provide a detailed explanation of what you are doing.
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc
Hm... Considering that "none" of the bootloaders work, and Bochs does not seem to do anything, perhaps you are not copying (or installing) your bootloader correctly in the first place?Danand wrote:Im trying to load my kernel! Im just testing with james tutorials. So when i test i get errors, i post the log over here. The bochs dont com up at all, so i need help then!
You can check this for certain using Bochs debugger. (Search Google for tutorials)
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
My kernel is in C, loader.s look like this:
"setting up the Multiboot header - see GRUB docs for details" mens that i must use GRUB? I have googled in days after boot loaders, nobody of them have worket, or them workt, but them not load the kernel!
Code: Select all
global _loader ; making entry point visible to linker
extern _kmain ; _kmain is defined elsewhere
; setting up the Multiboot header - see GRUB docs for details
MODULEALIGN equ 1<<0 ; align loaded modules on page boundaries
MEMINFO equ 1<<1 ; provide memory map
FLAGS equ MODULEALIGN | MEMINFO ; this is the Multiboot 'flag' field
MAGIC equ 0x1BADB002 ; 'magic number' lets bootloader find the header
CHECKSUM equ -(MAGIC + FLAGS) ; checksum required
section .text
align 4
MultiBootHeader:
dd MAGIC
dd FLAGS
dd CHECKSUM
; reserve initial kernel stack space
STACKSIZE equ 0x4000 ; that's 16k.
_loader:
mov esp, stack+STACKSIZE ; set up the stack
push eax ; pass Multiboot magic number
push ebx ; pass Multiboot info structure
call _kmain ; call kernel proper
hlt ; halt machine should kernel return
section .bss
align 32
stack:
resb STACKSIZE ; reserve 16k stack on a quadword boundary
Sorry my english, i'm from norway..
I write my own os now, DanOS. Website coming soon!
I write my own os now, DanOS. Website coming soon!
You do not *need* to use GRUB. Some members (myself included) developed their own bootloaders. If you are unable to get GRUB working, I would probably stay away from this for now... specifically if all you want to develop a kernel."setting up the Multiboot header - see GRUB docs for details" mens that i must use GRUB? I have googled in days after boot loaders, nobody of them have worket, or them workt, but them not load the kernel!
You still have not described how you are building everything (and copying the bootloader to your disk). Also, include what the problem is. How do you know it does not load the kernel? Is it even getting into _loader? What format is your kernel in (*.exe, *.elf, etc..)? How are you setting up GRUB?
We need details.
(Also, your loader.s is not at all a bootloader. I am suspecting GRUB is not set up correctly.)
Also, what compiler are you using for your C kernel? If you are sticking with 16 bit, I sure hope it can compile 16 bit real mode code and not 32 bit...
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}