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.
procedure TimerHandler(var Reg : TRegisters);
begin
Inc(TimerTicks);
end;
procedure Sleep(Ticks : LongWord);
var
ETicks: LongWord;
begin
ETicks := TimerTicks + Ticks;
while TimerTicks < ETicks do;
end;
The other problem is that I my kernel is at a stage where its size is 68Kb, however the problem is now my 2nd stage loader won't load the kernel properly. It just jumps to some code that is not mine! What is the problem? I know it is the 2nd stage loader because if my kernel has any code taken out ie:Beep procedure. It is less than 68Kb and then it loads and runs. Attached is my 2nd stage loader code.
...That looks like neon's second stage bootloader...
I assume that the loader has some issues with loading ANYTHING over 64 KB, but I can't scope it out. Sorry.
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I got the second stage loader from Brans Kernel Tutorials I think. It was from some tutorial. I just made slight changes to it because I needed a 2nd stage loader to continue. I will eventually write my own.
OK I figured out the PIT Sleep problem really stupid of me. I called the Sleep function in of the other units before I had run the STI command. So it all works fine now. Its just that 2nd stage loader
Gizmic OS
Currently - Busy with FAT12 driver and VFS
I just remember PIT needs STI. Sort of like the old batch file rule, SHIFT needs IF.
And yeah, that's the Brokenthorn tutorial second stage. I use the same one
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
Sadly, no. That loader can load flat binaries, which have a maximum size of 64KB. Anything bigger has to be a different executable format, like Windows PE, ELF, or something else.
It's the sad truth... You'd have to write your own loader to parse the header of the executable and set it up in the right way. Try checking the Wiki.
Troy
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
Originally the problem with 64KB was the real mode segments (I assume you know about that) but somehow I think it's carried over to pmode. You are in protected mode, right?
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.