Kernel image size calculation corrected
This commit is contained in:
parent
d7abbcf608
commit
39091a44c1
|
@ -152,8 +152,9 @@
|
||||||
│ │ ├── strtol.d
|
│ │ ├── strtol.d
|
||||||
│ │ └── strtol.o
|
│ │ └── strtol.o
|
||||||
│ ├── grub.log
|
│ ├── grub.log
|
||||||
│ ├── kernel.ld
|
│ ├── kaleid32_disasm.asm
|
||||||
│ └── qemu.log
|
│ ├── kaleid64_disasm.asm
|
||||||
|
│ └── kernel.ld
|
||||||
├── include
|
├── include
|
||||||
│ ├── base
|
│ ├── base
|
||||||
│ │ ├── assert.h
|
│ │ ├── assert.h
|
||||||
|
@ -258,4 +259,4 @@
|
||||||
├── ProjectTree
|
├── ProjectTree
|
||||||
└── README.md
|
└── README.md
|
||||||
|
|
||||||
41 directories, 192 files
|
41 directories, 193 files
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
[BITS 32]
|
[BITS 32]
|
||||||
extern kernelEnd
|
extern kernelEnd
|
||||||
|
extern _bss
|
||||||
global newKernelEnd
|
global newKernelEnd
|
||||||
global realKernelEnd
|
global realKernelEnd
|
||||||
|
|
||||||
|
@ -32,6 +33,7 @@ global realKernelEnd
|
||||||
KERNEL_STACK equ kernelEnd + 4096 * 2 * 1024 ; 8MB of stack
|
KERNEL_STACK equ kernelEnd + 4096 * 2 * 1024 ; 8MB of stack
|
||||||
newKernelEnd dq 0x0
|
newKernelEnd dq 0x0
|
||||||
realKernelEnd dq 0x0
|
realKernelEnd dq 0x0
|
||||||
|
|
||||||
[section .rodata]
|
[section .rodata]
|
||||||
;; GDT WITH DOC
|
;; GDT WITH DOC
|
||||||
ALIGN 4096
|
ALIGN 4096
|
||||||
|
@ -52,7 +54,7 @@ GDT64:
|
||||||
dq GDT64
|
dq GDT64
|
||||||
|
|
||||||
|
|
||||||
;; EMPTY PAGE TABLES (identity of the first 1GiB)
|
;; EMPTY PAGE TABLES (identity of the first 4GiB)
|
||||||
[section .bss]
|
[section .bss]
|
||||||
ALIGN 4096
|
ALIGN 4096
|
||||||
PML4_table:
|
PML4_table:
|
||||||
|
|
|
@ -29,14 +29,14 @@ ENTRY(MB_start) /* the name of the entry label */
|
||||||
SECTIONS {
|
SECTIONS {
|
||||||
. = 0x00100000; /* the code should be loaded at 1 MB */
|
. = 0x00100000; /* the code should be loaded at 1 MB */
|
||||||
|
|
||||||
.boot ALIGN (0x1000) : /* align at 4 KB */
|
.boot ALIGN (0x1000) :
|
||||||
{
|
{
|
||||||
*(.multiboot)
|
*(.multiboot)
|
||||||
}
|
}
|
||||||
|
|
||||||
.text ALIGN (0x1000) : /* align at 4 KB */
|
.text ALIGN (0x1000) :
|
||||||
{
|
{
|
||||||
*(.text) /* all text sections from all files */
|
*(.text)
|
||||||
}
|
}
|
||||||
|
|
||||||
.data ALIGN (0x1000) :
|
.data ALIGN (0x1000) :
|
||||||
|
@ -51,19 +51,19 @@ SECTIONS {
|
||||||
*(.eh_frame)
|
*(.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/ :
|
/DISCARD/ :
|
||||||
{
|
{
|
||||||
*(.comment)
|
*(.comment)
|
||||||
}
|
}
|
||||||
|
|
||||||
kernelEnd = .;
|
kernelEnd = .;
|
||||||
|
|
Loading…
Reference in New Issue