It occurs to me that sometimes, when I add a small bit of code (doesn't matter which sort of code, just plain C/C++ code), the kernel binary increases about 30 kB's in size. My normal kernel binary is around 84.4 kB at the moment and it randomly increases to 116 kB randomly sometimes. When I remove the last code I added, it drops back to its normal size. Sometimes when I add even more code when this appears, it disappears are strangely as it appears.
The first time this occurred, I checked my linker script and I saw that my rodata section was in the text section instead of the data section. OK, my mistake, I put it in the data section, problem fixed. Then, later, it happened again. I was using some Bochs debug functions, which I defined inline and statically in the header and as I knew header defines had given me some trouble before, I decided to give them their own CPP: Problem fixed.
Just now, it occurred again, this time with a plain operation like:
Code: Select all
MyVar = SomeOtherVar - AnotherOtherVar;
Code: Select all
ENTRY(BootEntry)
OUTPUT(../bin/Dynamix.bin)
OUTPUT_FORMAT("elf32-i386")
SECTIONS
{
/* 0x100000 = 1 MB. The kernel must be above 1 MB in order for GRUB to be able to load it. */
KERNEL_START = 0x100000;
.text KERNEL_START :
{
*(.text)
. = ALIGN(4096);
}
.data :
{
/* Constructor and destructor variables. */
LdConstrStart = .;
*(.ctor*)
LdConstrEnd = .;
LdDestrStart = .;
*(.dtor*)
LdDestrEnd = .;
*(.rodata*)
*(.data)
. = ALIGN(4096);
}
.bss :
{
*(.COMMON*)
*(.bss*)
. = ALIGN(4096);
}
LdEnd = .;
}
INPUT
(
/* 'asm' files. */
Boot.obj
CPUID.obj
Process.obj
Interrupts.obj
/* '/' directory files. */
Compiler.o
Main.o
/* 'cpplib' directory files. */
clib.o
/* 'emulators' directory files. */
Bochs.o
/* 'kernel' directory files. */
CPU.o
Kernel.o
Interrupts.o
Keyboard.o
IO.o
/* 'kernel/drives' directory files. */
Floppy.o
FAT.o
Drive.o
/* 'kernel/memory' directory files. */
Paging.o
Heap.o
Multitasking.o
/* 'kernel/ui' directory files. */
Shell.o
Commands.o
Menu.o
/* 'ttt' directory files. */
ttt.o
TTT_Class.o
)
Thanks for your time,
Creature