From 294e5d72ddb731be6424830b9898333ae9b6c1b3 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Sun, 7 Aug 2011 01:30:47 +0200 Subject: [PATCH] All of the initrd is now loaded. --- sortix/kernel.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sortix/kernel.cpp b/sortix/kernel.cpp index a0753d59..204ddd66 100644 --- a/sortix/kernel.cpp +++ b/sortix/kernel.cpp @@ -255,12 +255,12 @@ namespace Sortix { addr_t loadat = 0x400000UL; -#ifdef PLATFORM_VIRTUAL_MEMORY - ASSERT(initrdsize <= 4096); - addr_t apppage = Page::Get(); - - VirtualMemory::MapUser(loadat, apppage); -#endif + for ( size_t i = 0; i < initrdsize; i += 4096 ) + { + addr_t apppage = Page::Get(); + if ( apppage == 0 ) { Panic("kernel.cpp: not enough memory for initrd!"); } + VirtualMemory::MapUser(loadat + i, apppage); + } Memory::Copy((void*) loadat, initrd, initrdsize); initstart = (Thread::Entry) loadat;