I am making a 16-bit Real Mode OS in Nasm assembly. The whole OS is 1001 bytes large.
After working on the OS for a while It came to my attention that I was allocating data to RAM with no functions to show how much RAM was being used nor any functions to free the RAM.
I know that "0h00000500" to "0h00007BFF" can be used.
I also know that "0h00007E00" to "0h0007FFFF" can be used.
I also know that "0h00080000" to "0h0009FBFF" can be used.
This leads up to roughly 630 KB of RAM from these addresses however my memory detection function shows I have a total of 637 KB of RAM. Seven Kilobytes lost RAM really isn't that big of a deal to me but it does make me curious as to where it went.
Code I used to detect the amount of RAM:
Code: Select all
getmem:
mov ax, 0
mov si, 0
xor ax, ax
int 0x12
jc .Error
test ax, ax
jz .Error
mov si, ax ;The OS uses the si register for printing text to the screen
.Error:
ret
If you want me to post the entire source code of the OS I can.