I'm trying to reserve space for my kernel, so that kernel would be exactly 128 kB long. But the last 30 kB's of the total 128 kB kernel size must be reserved for "external programs linkage" - sssh, its a secret , so 30,5 kBytes are available for future use for kernel itself (128 - 30 = 98 - 67,5 [uncompressed kernel size] = 30,5 kBs). So I want my kernel to grow into that 128 kBs by zeroing:
Code: Select all
include 'system\blahblah'
...
include 'blah\blahblah'
...some small code here...
times (100352-($-$$)) db 0 ;grew into 98 kBs
TheSecret:
rb 30720 ;the reserved 30 kBs
flat assembler version 1.64
KRNL386.ASM [349]:
times (100352-($-$$)) db 0
error: invalid value.
But if I move that "times" code along with the "TheSecret" label + "rb 30720" instruction above the "include" section, it works , but the executable is not exactly 128 kB long (the includes are taking +4 kB). I know, I would fix this by subtracting 4096 from the 100352, but every time I would change and rebuild includes, I would have to adjust that number every time, no? [This would apply too if I would replace the "times" with "rb 38400", but I would have to adjust it before every build I think]...
I saw this limitation in real mode, when kernel was too long in real mode (addressing above 0xFFFF), it freezed.
What should I do?
Thank you for your answer.
Regards
inflater