Booting a basic OS
-
- Member
- Posts: 83
- Joined: Tue Feb 03, 2009 11:37 am
Booting a basic OS
I'm using the exact code from http://wiki.osdev.org/Bare_Bones. I made the floppy.img file and now I'm trying to boot it. I tried Bochs, but when I ran it, the boot screen kept repeating over and over. Then I tried QEMU for windows, and I couldn't figure out how to boot it from there. Then I tried Virtual Box, and that gave me an unhandled win32 exception and asked me to debug.
What's wrong?
What's wrong?
Re: Booting a basic OS
Hello,
In your bochs configuation file, add the following line:Run it again using Bochs and it should output a log file, os.log. Post the last few lines of that log (registers, any errors or PANICs here.)
I personally suspect either GRUB is not installed correctly or the floppy disk image is not being correctly copied over. I cannot troubleshoot further however until I see the log.
In your bochs configuation file, add the following line:
Code: Select all
log: os.log
I personally suspect either GRUB is not installed correctly or the floppy disk image is not being correctly copied over. I cannot troubleshoot further however until I see the log.
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();}
-
- Member
- Posts: 83
- Joined: Tue Feb 03, 2009 11:37 am
Re: Booting a basic OS
Sorry, I really didn't know which information you needed, so I just uploaded the whole file so you can see what you need.
os.log
Thanks for the help.
os.log
Thanks for the help.
Re: Booting a basic OS
Here is the important info from the log:
Code: Select all
00008023335i[BIOS ] Booting from 0000:7c00
00008334848i[FDD ] partial read() on floppy image returns 374/512
00008357581i[FDD ] read() on floppy image returns 0
...
00025568511i[FDD ] read() on floppy image returns 0
00025591244i[FDD ] read() on floppy image returns 0
00025625159i[FDD ] read() on floppy image returns 0
00025651077e[CPU0 ] check_cs(0x0008): attempt to jump to long mode without enabling EFER.LMA !
00025651077e[CPU0 ] check_cs(0x0008): conforming code seg descriptor dpl > cpl, dpl=3, cpl=0
00025651077i[CPU0 ] CPU is in protected mode (active)
00025651077i[CPU0 ] CS.d_b = 16 bit
00025651077i[CPU0 ] SS.d_b = 16 bit
00025651077i[CPU0 ] EFER = 0x00000000
00025651077i[CPU0 ] | RAX=0000000060000011 RBX=0000000000000001
00025651077i[CPU0 ] | RCX=0000000000000501 RDX=0000000000000000
00025651077i[CPU0 ] | RSP=0000000000001fec RBP=0000000000001ff0
00025651077i[CPU0 ] | RSI=00000000ffff8116 RDI=00000000000881f0
00025651077i[CPU0 ] | R8=0000000000000000 R9=0000000000000000
00025651077i[CPU0 ] | R10=0000000000000000 R11=0000000000000000
00025651077i[CPU0 ] | R12=0000000000000000 R13=0000000000000000
00025651077i[CPU0 ] | R14=0000000000000000 R15=0000000000000000
00025651077i[CPU0 ] | IOPL=0 id vip vif ac vm RF nt of df if tf sf zf af PF cf
00025651077i[CPU0 ] | SEG selector base limit G D
00025651077i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D
00025651077i[CPU0 ] | CS:0000( 0004| 0| 0) 00000000 0000ffff 0 0
00025651077i[CPU0 ] | DS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00025651077i[CPU0 ] | SS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00025651077i[CPU0 ] | ES:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00025651077i[CPU0 ] | FS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00025651077i[CPU0 ] | GS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00025651077i[CPU0 ] | MSR_FS_BASE:0000000000000000
00025651077i[CPU0 ] | MSR_GS_BASE:0000000000000000
00025651077i[CPU0 ] | RIP=0000000000008789 (0000000000008789)
00025651077i[CPU0 ] | CR0=0x60000011 CR1=0x0 CR2=0x0000000000000000
00025651077i[CPU0 ] | CR3=0x00000000 CR4=0x00000000
00025651077i[CPU0 ] >> jmp far 0008:00008791 : 66EA918700000800
00025651077e[CPU0 ] exception(): 3rd (13) exception with no resolution, shutdown status is 00h, resetting
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();}
-
- Member
- Posts: 83
- Joined: Tue Feb 03, 2009 11:37 am
Re: Booting a basic OS
Yea... I have no clue what that means. It's my first time doing this...
Re: Booting a basic OS
How much experience do you have with assembly language? If you know it (at least the basics) most of the log should be fairly easy to understand.gsingh2011 wrote:Yea... I have no clue what that means. It's my first time doing this...
However I do not have much experience with GRUB so cannot assist you in setting it up. Perhaps another member here can help you with that.
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();}
-
- Member
- Posts: 83
- Joined: Tue Feb 03, 2009 11:37 am
Re: Booting a basic OS
I do not have a very good understanding at assembly, although I attempted learning once. Thank you for all your help so far neon! Can anyone else identify the problem?
Re: Booting a basic OS
I suspect that it is failing inside of GRUB. I know it is booting into the boot loader (based upon that eip is not inside of the bios and above 0x7c00). Perhaps GRUB is not configured correctly? Or the floppy image is not built correctly?
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();}
- AndrewAPrice
- Member
- Posts: 2306
- Joined: Mon Jun 05, 2006 11:00 pm
- Location: USA (and Australia)
Re: Booting a basic OS
Code: Select all
00025651077i[CPU0 ] >> jmp far 0008:00008791 : 66EA918700000800
My OS is Perception.
- 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:
Re: Booting a basic OS
Also
Bochs is complaining to you about your floppy image being broken (it should be exactly 1.44Mb in size!)00025625159i[FDD ] read() on floppy image returns 0
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: Booting a basic OS
Look for bios.bin. It should either be in the sub-directory pc-bios, or in the main directory, depending on where you got the package from (as I'm assuming you haven't compiled it yourself). Then, try the following command:gsingh2011 wrote:Then I tried QEMU for windows, and I couldn't figure out how to boot it from there.
Code: Select all
qemu -fda floppy.img -boot a -L pc-bios
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]