Skip to content

Commit

Permalink
Merge pull request #36 from ethandmd/6-Allocator
Browse files Browse the repository at this point in the history
Dyanamic memory is off the ground
  • Loading branch information
TCCQ authored Mar 17, 2023
2 parents 7d5c317 + 7f57885 commit 11a4550
Show file tree
Hide file tree
Showing 21 changed files with 1,070 additions and 688 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[unstable]
build-std-features = ["compiler-builtins-mem"]
build-std = ["core", "compiler_builtins"]
build-std = ["core", "compiler_builtins", "alloc"]


[build]
Expand Down
8 changes: 8 additions & 0 deletions .gdbinit
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@ add-inferior
info threads
set schedule-multiple on
set output-radix 16
set print pretty on
define hook-quit
set confirm off
end
define hook-kill
set confirm off
end

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/target
*~
*.o
*.ELF
.rust*
26 changes: 14 additions & 12 deletions kernel.ld
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,16 @@ MEMORY
ram (wxa) : ORIGIN = 0x80000000, LENGTH = 128M
}

/* If you don't Align(16), it breaks. If you try to page align .text,
it breaks. Align seems to only work INSIDE sections. To make mapping
nice. Sections should be page aligned. */

SECTIONS
{
.text : {
*(.text .text.*)
. = ALIGN(0x1000);
PROVIDE(__text_end = .);
PROVIDE(_text_end = .);
PROVIDE(_etext = .);
}

PROVIDE(__global_pointer = .);
PROVIDE(_global_pointer = .);

.rodata : {
*(.srodata .srodata.*)
Expand All @@ -37,21 +33,27 @@ SECTIONS
/* lower guard page included in above */
.stacks : {
. = ALIGN(0x1000);
PROVIDE(__stacks_start = .);
. = . + (4096 * 2 * 2); /* NHARTS with a guard page each, unstable */
PROVIDE(__stacks_end = .);
PROVIDE(_stacks_start = .);
. = . + (4096 * 3 * 2); /* NHARTS with a guard page each, unstable */
PROVIDE(_stacks_end = .);
}
.intstacks : {
. = ALIGN(0x1000);
PROVIDE(_intstacks_start = .);
. = . + (0x1000 * 4 * 2);
PROVIDE(_intstacks_end = .);
}
. = . + 4096; /* guard page */
/* stacks should start at stack end and alternate with guard pages going down */

.bss : {
. = ALIGN(0x1000);
PROVIDE(__bss_start = .);
PROVIDE(_bss_start = .);
*(.sbss .sbss.*)
*(.bss .bss.*)
. = ALIGN(0x1000);
PROVIDE(__bss_end = .);
PROVIDE(_bss_end = .);
}
PROVIDE(_end = .);
PROVIDE(__memory_end = ORIGIN(ram) + LENGTH(ram));
PROVIDE(_memory_end = ORIGIN(ram) + LENGTH(ram));
}
Loading

0 comments on commit 11a4550

Please sign in to comment.