重构内存分配器、增加中断支持、整理rust运行时环境 #4

Merged
pointer-to-bios merged 39 commits from downstream into main 2024-04-11 00:36:14 +08:00
3 changed files with 8 additions and 10 deletions
Showing only changes of commit 320ceaa56d - Show all commits

View File

@ -1,6 +1,6 @@
SOURCE := $(shell pwd)/src/scripts SOURCE := $(shell pwd)/src/scripts
.PHONY: all clear run debug config .PHONY: all clear run debug config disass
all: config all: config
@make -C src all --no-print-directory @make -C src all --no-print-directory
@ -25,3 +25,6 @@ config:
touch metaverse_kernel; \ touch metaverse_kernel; \
"${SOURCE}/depcheck"; \ "${SOURCE}/depcheck"; \
fi fi
disass:
objdump -D src/metaverse.elf > kerndisass.txt

View File

@ -9,7 +9,8 @@
* *
* *
* *
* * 0 \~ 2MB使 * * 0 \~ 1MB
* * 1MB \~ 2MB
* * 2MB \~ 4MB * * 2MB \~ 4MB
* * 4MB \~ 16MB * * 4MB \~ 16MB
* * 16MB \~ ? * * 16MB \~ ?

View File

@ -16,14 +16,6 @@ typedef struct __raw_allocator_cell
} raw_allocator_cell; } raw_allocator_cell;
#define raw_allocator_next_cell(cell) (raw_allocator_cell *)((void *)((cell)->content) + (cell)->capacity) #define raw_allocator_next_cell(cell) (raw_allocator_cell *)((void *)((cell)->content) + (cell)->capacity)
// 原始分配器
//
// 包括至少一个cell分配时像cell的分裂一样将空白的一段分成两段
// 释放时只把length归零并不将cell合并。
// length=0的cell称为空cell
//
// 统计从上次细胞合并以来free的调用次数当调用次数很多或可用空间不足时
// 触发细胞合并。
/** /**
* @name raw_allocator_t * @name raw_allocator_t
* *
@ -33,6 +25,8 @@ typedef struct __raw_allocator_cell
* *
* free的调用次数`RAW_ALLOCATOR_FREE_MAX` * free的调用次数`RAW_ALLOCATOR_FREE_MAX`
* *
* 使allocate和free的情况下使用使allocate时效率低下并难以得到内存安全保证
*
* @internal free_count * @internal free_count
* *
* free方法的调用次数`RAW_ALLOCATOR_FREE_MAX` * free方法的调用次数`RAW_ALLOCATOR_FREE_MAX`