mirror of
https://github.com/drasko/codezero.git
synced 2026-08-26 00:00:06 +02:00
Pager works until end of init_physmem_secondary
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Bahadir Balban
|
||||
*/
|
||||
#ifndef __MM_KDATA_H__
|
||||
#define __MM_KDATA_H__
|
||||
|
||||
#include <l4/macros.h>
|
||||
#include <l4/config.h>
|
||||
#include <l4/types.h>
|
||||
#include <l4/generic/physmem.h>
|
||||
#include INC_PLAT(offsets.h)
|
||||
#include INC_GLUE(memory.h)
|
||||
#include INC_GLUE(memlayout.h)
|
||||
#include INC_ARCH(bootdesc.h)
|
||||
|
||||
struct initdata {
|
||||
struct bootdesc *bootdesc;
|
||||
};
|
||||
|
||||
extern struct initdata initdata;
|
||||
|
||||
int request_initdata(struct initdata *i);
|
||||
|
||||
#endif /* __MM_KDATA_H__ */
|
||||
@@ -12,7 +12,6 @@
|
||||
#include <l4lib/ipcdefs.h>
|
||||
#include <fs.h>
|
||||
#include <init.h>
|
||||
#include <kdata.h>
|
||||
#include <syscalls.h>
|
||||
#include <task.h>
|
||||
#include <posix/sys/time.h>
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include <vfs.h>
|
||||
#include <bdev.h>
|
||||
#include <task.h>
|
||||
#include <kdata.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <l4/lib/list.h>
|
||||
@@ -58,7 +57,7 @@ int initialise(void)
|
||||
struct superblock *root_sb;
|
||||
|
||||
/* Get standard init data from microkernel */
|
||||
request_initdata(&initdata);
|
||||
// request_initdata(&initdata);
|
||||
|
||||
/* Register compiled-in filesystems with vfs core. */
|
||||
vfs_register_filesystems();
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Requesting system information from kernel during init.
|
||||
*
|
||||
* Copyright (C) 2007 Bahadir Balban
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <l4lib/arch/syscalls.h>
|
||||
#include <kdata.h>
|
||||
#include <string.h>
|
||||
#include INC_API(kip.h)
|
||||
#include <task.h>
|
||||
|
||||
/* Kernel data acquired during initialisation */
|
||||
struct initdata initdata;
|
||||
|
||||
#define BOOTDESC_PREALLOC_SIZE 128
|
||||
|
||||
static char bootdesc_memory[BOOTDESC_PREALLOC_SIZE]; /* 128 bytes */
|
||||
|
||||
void print_bootdesc(struct bootdesc *bd)
|
||||
{
|
||||
for (int i = 0; i < bd->total_images; i++) {
|
||||
printf("Task Image: %d\n", i);
|
||||
printf("Name: %s\n", bd->images[i].name);
|
||||
printf("Start: 0x%x\n", bd->images[i].phys_start);
|
||||
printf("End: 0x%x\n", bd->images[i].phys_end);
|
||||
}
|
||||
}
|
||||
|
||||
int request_initdata(struct initdata *initdata)
|
||||
{
|
||||
int err;
|
||||
int bootdesc_size;
|
||||
|
||||
/* Read the boot descriptor size */
|
||||
if ((err = l4_kread(KDATA_BOOTDESC_SIZE, &bootdesc_size)) < 0) {
|
||||
printf("L4_kdata_read() call failed. Could not complete"
|
||||
"KDATA_BOOTDESC_SIZE request.\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (bootdesc_size > BOOTDESC_PREALLOC_SIZE) {
|
||||
printf("Insufficient preallocated memory for bootdesc. "
|
||||
"Size too big.\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* Get preallocated bootdesc memory */
|
||||
initdata->bootdesc = (struct bootdesc *)&bootdesc_memory;
|
||||
|
||||
/* Read the boot descriptor */
|
||||
if ((err = l4_kread(KDATA_BOOTDESC, initdata->bootdesc)) < 0) {
|
||||
printf("L4_kdata_read() call failed. Could not complete"
|
||||
"KDATA_BOOTDESC request.\n");
|
||||
goto error;
|
||||
}
|
||||
return 0;
|
||||
|
||||
error:
|
||||
printf("FATAL: %s failed during initialisation. exiting.\n", __TASKNAME__);
|
||||
return err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user