summaryrefslogtreecommitdiff
path: root/kern/bootstrap.c
diff options
context:
space:
mode:
Diffstat (limited to 'kern/bootstrap.c')
-rw-r--r--kern/bootstrap.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/kern/bootstrap.c b/kern/bootstrap.c
index 8b88d17d..d0afa1ef 100644
--- a/kern/bootstrap.c
+++ b/kern/bootstrap.c
@@ -51,6 +51,7 @@
#include <vm/vm_user.h>
#include <vm/pmap.h>
#include <device/device_port.h>
+#include <device/ramdisk.h>
#if MACH_KDB
#include <machine/db_machdep.h>
@@ -817,6 +818,23 @@ boot_script_free (void *ptr, unsigned int size)
}
int
+boot_script_ramdisk_create (struct cmd *cmd, char **name)
+{
+ struct multiboot_module *mod = cmd->hook;
+ vm_size_t size = mod->mod_end - mod->mod_start;
+ kern_return_t rc;
+ int no;
+
+ rc = ramdisk_create (size, (void *) phystokv (mod->mod_start), &no);
+ if (rc != KERN_SUCCESS)
+ return BOOT_SCRIPT_MACH_ERROR;
+
+ *name = boot_script_malloc (RAMDISK_NAMESZ);
+ sprintf(*name, RAMDISK_NAME "%d", no);
+ return 0;
+}
+
+int
boot_script_task_create (struct cmd *cmd)
{
kern_return_t rc = task_create_kernel(TASK_NULL, FALSE, &cmd->task);