Kernel image size calculation corrected

This commit is contained in:
Adrien Bourmault 2019-05-11 22:26:40 +02:00
parent d7abbcf608
commit 39091a44c1
3 changed files with 16 additions and 13 deletions

View File

@ -152,8 +152,9 @@
│   │   ├── strtol.d
│   │   └── strtol.o
│   ├── grub.log
│   ├── kernel.ld
│   └── qemu.log
│   ├── kaleid32_disasm.asm
│   ├── kaleid64_disasm.asm
│   └── kernel.ld
├── include
│   ├── base
│   │   ├── assert.h
@ -258,4 +259,4 @@
├── ProjectTree
└── README.md
41 directories, 192 files
41 directories, 193 files

View File

@ -25,6 +25,7 @@
[BITS 32]
extern kernelEnd
extern _bss
global newKernelEnd
global realKernelEnd
@ -32,6 +33,7 @@ global realKernelEnd
KERNEL_STACK equ kernelEnd + 4096 * 2 * 1024 ; 8MB of stack
newKernelEnd dq 0x0
realKernelEnd dq 0x0
[section .rodata]
;; GDT WITH DOC
ALIGN 4096
@ -52,7 +54,7 @@ GDT64:
dq GDT64
;; EMPTY PAGE TABLES (identity of the first 1GiB)
;; EMPTY PAGE TABLES (identity of the first 4GiB)
[section .bss]
ALIGN 4096
PML4_table:

View File

@ -29,14 +29,14 @@ ENTRY(MB_start) /* the name of the entry label */
SECTIONS {
. = 0x00100000; /* the code should be loaded at 1 MB */
.boot ALIGN (0x1000) : /* align at 4 KB */
.boot ALIGN (0x1000) :
{
*(.multiboot)
}
.text ALIGN (0x1000) : /* align at 4 KB */
.text ALIGN (0x1000) :
{
*(.text) /* all text sections from all files */
*(.text)
}
.data ALIGN (0x1000) :
@ -51,14 +51,14 @@ SECTIONS {
*(.eh_frame)
}
.bss ALIGN (0x1000) : /* align at 4 KB */
.rodata ALIGN (0x1000) :
{
*(.bss) /* all bss sections from all files */
*(.rodata)
}
.rodata ALIGN (0x1000) : /* align at 4 KB */
.bss ALIGN (0x1000) :
{
*(.rodata) /* all rodata sections from all files */
*(.bss)
}
/DISCARD/ :