Feat: lab 3

This commit is contained in:
2025-04-01 17:13:46 +08:00
parent 96cfdc4de2
commit 5ae11ac062
10 changed files with 197 additions and 65 deletions

View File

@@ -42,20 +42,7 @@ void _print_time(uint64_t)
uint64_t cntpct_el0, cntfrq_el0;
R_SYSREG(cntpct_el0, cntpct_el0);
R_SYSREG(cntfrq_el0, cntfrq_el0);
DEBUG_EXCEP(cntpct_el0 / cntpct_el0);
}
void main(void *dtb)
{
file_node_t *initrd_root = 0x0;
init(dtb, &initrd_root);
LOG("system booting in");
_print_time(0x0);
uint64_t cntpct_el0, cntfrq_el0;
R_SYSREG(cntpct_el0, cntpct_el0);
R_SYSREG(cntfrq_el0, cntfrq_el0);
DEBUG_EXCEP(cntpct_el0 / cntfrq_el0);
task_t task = {
.firing_tick = cntpct_el0 + 2 * cntfrq_el0,
@@ -67,6 +54,15 @@ void main(void *dtb)
};
add_task(task);
}
void main(void *dtb)
{
file_node_t *initrd_root = 0x0;
init(dtb, &initrd_root);
LOG("system booting in");
_print_time(0x0);
uint64_t el;
R_SYSREG(el, CurrentEL);