..

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
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

..

Post by Bender »

..
Last edited by Bender on Wed Mar 19, 2014 4:39 am, edited 1 time in total.
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
User avatar
Nessphoro
Member
Member
Posts: 308
Joined: Sat Apr 30, 2011 12:50 am

Re: What you happen if my Kernel size is greater than 24K?

Post by Nessphoro »

Nothing.
Why such an arbitrary number?
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

Re: What you happen if my Kernel size is greater than 24K?

Post by Bender »

Because I have heard that in Real Mode in a 64K Memory Segment :
Disk Buffer - 8K
Kernel - 24K
Other Stuff - 32K
So I thought that if my Kernel is more than 24K, there would be a problem.......
Last edited by Bender on Fri Oct 04, 2013 11:01 pm, edited 1 time in total.
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
User avatar
Nessphoro
Member
Member
Posts: 308
Joined: Sat Apr 30, 2011 12:50 am

Re: What you happen if my Kernel size is greater than 24K?

Post by Nessphoro »

8K? Thats a pretty massive bootsector.
Honestly, though, it all depends on how you utilize the memory.
If you're doing it in assembly then you have all the power. However, if you were using a compiler then you might have some problems.
But nothing stops you from having different segments for CS, DS, SS and etc.
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

Re: What you happen if my Kernel size is greater than 24K?

Post by Bender »

ooops!
8K is not the bootsector but the disk buffer...
And I have avoided the use of segment registers...
(I am sorry if this is irritating)
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: What you happen if my Kernel size is greater than 24K?

Post by bluemoon »

sid123 wrote:I have heard...
To enter the great mystery world of OS development, you gotta read the manual and specifications, and performance tests, but not blindly trust anything you heard.

Your calculation assume a so-call tiny memory model, where the compiler assume everything lies within the same segment. However, real model itself has better flexibility, you can adjust the segment register to access roughly 1M of memory (address FFFF:FFFF and read 4 bytes there, to be exact)
linguofreak
Member
Member
Posts: 510
Joined: Wed Mar 09, 2011 3:55 am

Re: What you happen if my Kernel size is greater than 24K?

Post by linguofreak »

sid123 wrote:ooops!
8K is not the bootsector but the disk buffer...
And I have avoided the use of segment registers...
(I am sorry if this is irritating)
If you're limiting yourself to a single segment, there could be any number of reasons that you're not seeing any problem.

You may not have allocated things like you think you have, so that your kernel has more room than you think.

You may actually have a problem that hasn't become visible yet: Your kernel may be being loaded with the tail end of it sticking into your "other stuff" space, and then it may be that that tail end is being overwritten by "other stuff", but the functions at the end of the kernel aren't used often, so it's not crashing yet, even though it's already damaged.

If the only thing in the "other stuff" space so far is your stack, it is quite likely that you simply aren't using enough space on the stack yet to start impinging on your kernel.

If you're writing this in C rather than assembly, it may be that you think you're just using one segment but your compiler is actually doing something else.

In general though, there's no need to limit yourself to a single segment (except for a challenge), there's little or no reason to limit yourself to real mode, and just because you're limiting yourself to 64k doesn't mean you have to split it 8/24/32.
Post Reply