mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 10:53:16 +01:00
- fixed is_err(x), was evaluating x twice, resulting in calling a function x twice. - Divided task initialisation into multiple parts. - MM0 now creates a tcb for itself and maintains memory regions of its own. - MM0's tcb is used for mmapping other tasks' regions. MM0 mmaps and prefaults those regions, instead of the typical mmap() and fault approach used by non-pager tasks. For example there's an internal shmget_shmat() path to map in other tasks' shm utcbs. Those mappings are then prefaulted into mm0's address space using the default fault handling path. - FS0 now reads task data into its utcb from mm0 via a syscall. FS0 shmat()s to utcbs of other tasks, e.g. mm0 and test0. FS0 then crashes, that is to be fixed and where this commit is left last.
104 lines
1.6 KiB
Plaintext
104 lines
1.6 KiB
Plaintext
|
|
Virtual memory layout on Codezero/ARMv5:
|
|
========================================
|
|
|
|
|
|
|
|
0xFFFF FFFF .---------------. End of virtual memory
|
|
| Syscall page |
|
|
0xFFFF F000 |---------------|
|
|
| Reserved |
|
|
0xFFFF 1000 |---------------|
|
|
| Vector page |
|
|
0xFFFF 0000 |---------------|
|
|
| Reserved |
|
|
0xF900 0000 |---------------| UTCB area ends
|
|
| |
|
|
| ... |
|
|
| --------- |
|
|
| UTCB page |
|
|
| --------- |
|
|
| UTCB page |
|
|
0xF800 0000 |---------------| UTCB area starts
|
|
| |
|
|
| Codezero |
|
|
| Microkernel |
|
|
| |
|
|
0xF000 0000 |---------------|
|
|
| |
|
|
| MM0 pager |
|
|
| |
|
|
0xE000 0000 |---------------|
|
|
| |
|
|
| |
|
|
| Reserved |
|
|
| |
|
|
| |
|
|
| ... |
|
|
0x2000 0000 |---------------| User task area ends
|
|
| |
|
|
| |
|
|
| |
|
|
| Task |
|
|
| Address Space |
|
|
| |
|
|
| |
|
|
0x1000 0000 |---------------| User task area starts
|
|
| |
|
|
| |
|
|
| Reserved |
|
|
| |
|
|
| |
|
|
0x0 '---------------' Start of virtual memory
|
|
|
|
|
|
|
|
|
|
User task address space layout on Codezero/ARMv5:
|
|
=================================================
|
|
|
|
0xF8xx x000 .---------------.
|
|
| Task's UTCB |
|
|
0xF8xx x000 '---------------'
|
|
|
|
|
|
0x2000 0000 .---------------. End of user task address space
|
|
|4KB Environment|
|
|
0x1FFF F000 |---------------|
|
|
| 16KB Stack |
|
|
| | |
|
|
| v |
|
|
| |
|
|
0x1FFE F000 |---------------|
|
|
| |
|
|
| Memory |
|
|
| available |
|
|
| for mmap() |
|
|
| |
|
|
0x1xxx x000 |---------------|
|
|
| BSS |
|
|
|---------------|
|
|
| Data |
|
|
|---------------|
|
|
| Text |
|
|
0x1000 0000 '---------------' Start of user task address space
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|