..
- Bender
- Member
- Posts: 449
- Joined: Wed Aug 21, 2013 3:53 am
- Libera.chat IRC: bender|
- Location: Asia, Singapore
..
..
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)
(R3X Runtime VM)(CHIP8 Interpreter OS)
Re: What you happen if my Kernel size is greater than 24K?
Nothing.
Why such an arbitrary number?
Why such an arbitrary number?
- Bender
- 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?
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.......
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)
(R3X Runtime VM)(CHIP8 Interpreter OS)
Re: What you happen if my Kernel size is greater than 24K?
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.
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.
- Bender
- 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?
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)
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)
(R3X Runtime VM)(CHIP8 Interpreter OS)
Re: What you happen if my Kernel size is greater than 24K?
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.sid123 wrote:I have 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)
-
- Member
- Posts: 510
- Joined: Wed Mar 09, 2011 3:55 am
Re: What you happen if my Kernel size is greater than 24K?
If you're limiting yourself to a single segment, there could be any number of reasons that you're not seeing any problem.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)
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.