git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change of vterm handling logic on backend chardev input event (#40)
[lunaix-os.git]
/
lunaix-os
/
kernel
/
kinit.c
diff --git
a/lunaix-os/kernel/kinit.c
b/lunaix-os/kernel/kinit.c
index b19dc30dc34ed7d7725d3f38be43e92d13e8b08b..24550cf5192829fc2c7eb91adb0224dfe9038340 100644
(file)
--- a/
lunaix-os/kernel/kinit.c
+++ b/
lunaix-os/kernel/kinit.c
@@
-16,10
+16,9
@@
#include <lunaix/trace.h>
#include <lunaix/tty/tty.h>
#include <lunaix/owloysius.h>
#include <lunaix/trace.h>
#include <lunaix/tty/tty.h>
#include <lunaix/owloysius.h>
-#include <lunaix/
pcontext
.h>
+#include <lunaix/
hart_state
.h>
#include <hal/acpi/acpi.h>
#include <hal/acpi/acpi.h>
-#include <hal/intc.h>
#include <sys/abi.h>
#include <sys/mm/mm_defs.h>
#include <sys/abi.h>
#include <sys/mm/mm_defs.h>
@@
-36,9
+35,11
@@
kmem_init(struct boot_handoff* bhctx);
void
kernel_bootstrap(struct boot_handoff* bhctx)
{
void
kernel_bootstrap(struct boot_handoff* bhctx)
{
- pmm_init(bhctx->mem.size);
vmm_init();
vmm_init();
+ pmm_init(bhctx);
+ // now we can start reserving physical space
+
/* Begin kernel bootstrapping sequence */
boot_begin(bhctx);
/* Begin kernel bootstrapping sequence */
boot_begin(bhctx);
@@
-52,16
+53,9
@@
kernel_bootstrap(struct boot_handoff* bhctx)
device_scan_drivers();
device_scan_drivers();
- invoke_init_function(on_earlyboot);
-
- // FIXME this goes to hal/gfxa
- tty_init(ioremap(0xB8000, PAGE_SIZE));
- tty_set_theme(VGA_COLOR_WHITE, VGA_COLOR_BLACK);
-
device_sysconf_load();
device_sysconf_load();
- /* Get intc online, this is the cornerstone when initing devices */
- intc_init();
+ invoke_init_function(on_earlyboot);
clock_init();
timer_init();
clock_init();
timer_init();
@@
-93,7
+87,6
@@
kernel_bootstrap(struct boot_handoff* bhctx)
* and start geting into uspace
*/
boot_end(bhctx);
* and start geting into uspace
*/
boot_end(bhctx);
- boot_cleanup();
spawn_lunad();
}
spawn_lunad();
}
@@
-122,15
+115,17
@@
spawn_lunad()
void
kmem_init(struct boot_handoff* bhctx)
{
void
kmem_init(struct boot_handoff* bhctx)
{
- extern u8_t __kexec_end;
- // 将内核占据的页,包括前1MB,hhk_init 设为已占用
- size_t pg_count = leaf_count((ptr_t)&__kexec_end - KERNEL_RESIDENT);
- pmm_mark_chunk_occupied(0, pg_count, PP_FGLOCKED);
-
pte_t* ptep = mkptep_va(VMS_SELF, KERNEL_RESIDENT);
pte_t* ptep = mkptep_va(VMS_SELF, KERNEL_RESIDENT);
+
ptep = mkl0tep(ptep);
ptep = mkl0tep(ptep);
+ unsigned int i = ptep_vfn(ptep);
do {
do {
+ if (l0tep_impile_vmnts(ptep)) {
+ ptep++;
+ continue;
+ }
+
#if LnT_ENABLED(1)
assert(mkl1t(ptep++, 0, KERNEL_DATA));
#elif LnT_ENABLED(2)
#if LnT_ENABLED(1)
assert(mkl1t(ptep++, 0, KERNEL_DATA));
#elif LnT_ENABLED(2)
@@
-140,7
+135,7
@@
kmem_init(struct boot_handoff* bhctx)
#else
assert(mklft(ptep++, 0, KERNEL_DATA));
#endif
#else
assert(mklft(ptep++, 0, KERNEL_DATA));
#endif
- } while (
ptep_vfn(ptep) < MAX_PTEN - 2
);
+ } while (
++i < MAX_PTEN
);
// allocators
cake_init();
// allocators
cake_init();