problem with kernel

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
vilcko
Posts: 1
Joined: Fri Jun 18, 2021 7:33 am

problem with kernel

Post by vilcko »

Long story short, I am tring to run an custom os on REAL hardware. I am using http://www.brokenthorn.com/Resources/OSDevIndex.html this tutorial as guild line(more like copy 99% of there code there). I made it to page 20 there (demo15) and there i got into a problem, its explained there how to read from a flopy, and I have a hard drive in the laptop! so i started working on a ahci and pci driver and it was going pretty well. But then somthing wired happend I discoved that when the kernel size is more than 17kb is doesnt work. I have no idea to why and i have been stuck on it for 5 days now working on it every day. I know its the size that matter and not the code through my experiments with it. But it runs ok in Bochs only not on read hardwear.

Everything works as long as the kernel is less than 17kb and if its not than when its jump to the kernel entry point is stops or start a infinit loop where it restarts itself for some reason. Well wasnt very short story in the end sorry.

Anyway It will be realy helpful if someone has any idea to why its like that or how to fix it.
I know you dont have my laptop so you cant realy test anything but even an idea to why will help my.

my code is on github https://github.com/xXvilckoXx/os, here.
I am working on VS C++ 2010 express.

Sorry for my bad english and thank to everyone who takes his time to try help me or even just reading this post! You can ask me questions in the comments and I will answer them as soon as I can.
Octocontrabass
Member
Member
Posts: 5568
Joined: Mon Mar 25, 2013 7:01 pm

Re: problem with kernel

Post by Octocontrabass »

Does it do the same thing when you boot it in a virtual machine, such as QEMU? Problems like this are difficult to debug on bare metal.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: problem with kernel

Post by neon »

Hi,

Are you sure you pushed all source files?
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Post Reply