Skip to content

Commit 0d557b8

Browse files
committed
If we have better RAM then why stuck at 1MB
1 parent b5649a2 commit 0d557b8

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

include/fuzzy/memmgr/layout.asm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22

33
; START_ENSURE_SAME_layout_h
44
MEMORY_APP_SIZE EQU 0x20000
5+
MEMORY_KERNEL_SIZE EQU 0x64000
56
; END_ENSURE_SAME_layout_h
67

78
; Kernel core is app with pid 0
89
; Kernel event is trigged via IRQ0 or syscall,
910
STACKINIT_APP EQU (MEMORY_APP_SIZE-4)
10-
STACKINIT_KERNEL_CORE EQU (STACKINIT_APP-4)
11+
STACKINIT_KERNEL_CORE EQU (MEMORY_KERNEL_SIZE/2)
1112

1213
; Should be able to store
1314
; - syscall and all internal calls
1415
; - ISRs and all internal calls
15-
STACKINIT_KERNEL_EVENT EQU 0x18000
16+
STACKINIT_KERNEL_EVENT EQU (MEMORY_KERNEL_SIZE-4)
1617

include/fuzzy/memmgr/layout.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@
2424
* Resolution:
2525
* - I'm not sure.
2626
*/
27-
#define MEMORY_APPBASE_LOCATION 0x10000
27+
#define MEMORY_APPBASE_LOCATION 0x100000
2828

29-
#define memmgr_app_abs_location(pid) ((pid==0)?0x0F000:(MEMORY_APPBASE_LOCATION + (pid)*MEMORY_APP_SIZE))
30-
#define memmgr_app_size(pid) (MEMORY_APP_SIZE)
29+
// Keep in sync with memory_layout.md
30+
#define memmgr_app_abs_location(pid) ((pid==PID_KERNEL)?0x0C000:(MEMORY_APPBASE_LOCATION + (pid)*MEMORY_APP_SIZE))
31+
#define memmgr_app_size(pid) ((pid==PID_KERNEL)?0x64000:MEMORY_APP_SIZE)
3132

3233
#define MEMORY_KERNEL_LOCATION (memmgr_app_abs_location(PID_KERNEL))
3334
#define MEMORY_KERNEL_SIZE (memmgr_app_size(PID_KERNEL))

memory_layout.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
|--------- |-------- |-------- |-------------------------------------------- |
55
| 0x00000 | 0x003FF | - | IVT (standard) |
66
| 0x00400 | 0x07BFF | - | BIOS data area + reserve |
7-
| 0x07C00 | 0x07DFF | 512B | Bootloader Stage 1 |
8-
| 0x07E00 | 0x07FFF | 512B | STATIC CODE for real_mode library |
9-
| 0x08000 | 0x0BFFF | - | Bootloader Stage 2 + own stack |
10-
| 0x0F000 | 0x2EFFF | 128KB | Kernel + (core, irq, syscall) stack |
11-
| 0x30000 | 0x4FFFF | 128KB | App pid 1 |
12-
| 0x50000 | 0x6FFFF | 128KB | App pid 2 |
7+
| 0x07C00 | 0x07DFF | 512B | Bootloader Stage 1 |
8+
| 0x07E00 | 0x07FFF | 512B | STATIC CODE for real_mode library |
9+
| 0x08000 | 0x0BFFF | 16KB | Bootloader Stage 2 + own stack |
10+
| 0x0C000 | 0x6FFFF | 400KB | Kernel + (core, isr, syscall) stack |
1311
| 0x70000 | 0x7FFFF | 64KB | Extra space for real_mode library+client |
1412
| 0x80000 | 0x9FFFF | 128KB | Extended BIOS Data area |
1513
| 0xA0000 | 0xBFFFF | 128KB | Video memory |
1614
| 0xC0000 | 0xFFFFF | 256KB | BIOS stuff |
15+
| 0x100000 | 0x1FFFFF | 1MB | Kernel future location (not used) |
16+
| 0x200000 | 0x2FFFFF | 1MB | App pid 1 |
17+
| 0x300000 | 0x3FFFFF | 1MB | App pid 2 |
18+
| ... | .... | 1MB | App ... |

0 commit comments

Comments
 (0)