hi I am a dev who love try things and I have one project, it's to make an entire os with my friends but I have a problem and I don't know that who can answer it so I put it here:
when my machine start there is an blue screen which is normal but my machine is rebooting again and again I am on linux I use BOCHS os emulator an thats my code, https://github.com/Strong214356/LPOS the first code who load in the bios is bootloader.asm (the comp.sh file is my compiler script tell me if something could be wrong in it) and I am loocking at a youtube serie: https://www.youtube.com/playlist?list=P ... a8l0Jb6l8-
can someone help me or did I have to put my question on an another forum
thanks for your answers
problem to pass from asm to c
Re: problem to pass from asm to c
Welcome to OSDev forum!
If you really are on linux, then these won't work:
Replace them with correct drivers.
You probably should start by reading our wiki instead of watching youtube. Here are some links:
- Introduction
- Beginner Mistakes
- Getting Started
- Using Bochs
Now, about your bootloader.asm, there are so many things wrong with it.
- you assume that your code is loaded and executed at 0:0x7C00 (requires ORG 0x7C00), but it could be 0x7C0:0 (requires ORG 0) as well (read more about real mode segmentation to learn why these two result in the same linear address).
- you should start your code with a short jump, some BIOS checks for this
- you haven't set up the segment registers (you can't access data otherwise, and you haven't set up code segment either)
- you haven't set up a stack (you can't use the "call" instruction otherwise)
- you haven't set the CPU flags (most notably the direction and interrupt flags)
Cheers,
bzt
No it's not normal. With bochs, you should see messages in white on black background.Strong214356 wrote:when my machine start there is an blue screen which is normal
That's because you made an error which causes an exception, but you haven't set up exception handlers yet, which cause another exception, so you end up with a triple fault, that reboots the CPU.Strong214356 wrote:but my machine is rebooting again and again
You can configure bochs to drop you in the debugger in case of a triple fault. It can also print the exceptions, so you can see where the first exception happens. Add these to your bochs.rc file:Strong214356 wrote:I am on linux I use BOCHS os emulator
Code: Select all
info: action=report
error: action=report
panic: action=ask
Code: Select all
config_interface: win32config
display_library: win32
Yeah, watching a youtube tutorial is not something that you do with OSDev. This isn't a user space application usage kind of thing, developing an OS is very very HARD, and requires lots and lots of knowledge and experience. Watching some video won't substitute that experience.Strong214356 wrote:I am loocking at a youtube serie: https://www.youtube.com/playlist?list=P ... a8l0Jb6l8-
You probably should start by reading our wiki instead of watching youtube. Here are some links:
- Introduction
- Beginner Mistakes
- Getting Started
- Using Bochs
Now, about your bootloader.asm, there are so many things wrong with it.
- you assume that your code is loaded and executed at 0:0x7C00 (requires ORG 0x7C00), but it could be 0x7C0:0 (requires ORG 0) as well (read more about real mode segmentation to learn why these two result in the same linear address).
- you should start your code with a short jump, some BIOS checks for this
- you haven't set up the segment registers (you can't access data otherwise, and you haven't set up code segment either)
- you haven't set up a stack (you can't use the "call" instruction otherwise)
- you haven't set the CPU flags (most notably the direction and interrupt flags)
Cheers,
bzt
- Thunderbirds747
- Member
- Posts: 83
- Joined: Sat Sep 17, 2016 2:14 am
- Location: Moscow, Russia
Re: problem to pass from asm to c
Greetings and welcome to OSDev, where we help you understand OSDeving!Strong214356 wrote:hi I am a dev who love try things and I have one project, it's to make an entire os with my friends but I have a problem and I don't know that who can answer it so I put it here:
when my machine start there is an blue screen which is normal but my machine is rebooting again and again I am on linux I use BOCHS os emulator an thats my code, https://github.com/Strong214356/LPOS the first code who load in the bios is bootloader.asm (the comp.sh file is my compiler script tell me if something could be wrong in it) and I am loocking at a youtube serie: https://www.youtube.com/playlist?list=P ... a8l0Jb6l8-
can someone help me or did I have to put my question on an another forum
thanks for your answers
You can browse around the Interwebz if you are learning OSDev, Google will most certainly help you, but IOHO (In Our Honest Opinion), it's best you take some courses on YouTube, Codecademy in order to familiarise yourself with programming.
The best way is research source code, the Wiki has some resources to help you get started.
If you don't really know much stuff, no worries, copy and paste, it's totally acceptable here on OSDev Forum!
Bochs uses its own video driver embedded into SeaBIOS, but you can find some BIOS roms on the Web
Thank you,
Timothy.
Coffee is not airplane fuel.