#USB/OHCI
MODULES += USB/HID USB/MSC
#MODULES += Interfaces/UDI
+
+DYNMODS += Filesystems/InitRD
# Creates a stripped and compressed copy of the kernel
# and installs it to the target
install: $(BIN)
- @cp $(BIN) $(BIN)_
- @$(STRIP) $(BIN)_
- @gzip -c $(BIN)_ > $(GZBIN)
- @$(RM) $(BIN)_
$(xCP) $(GZBIN) $(DISTROOT)
# Compile API documentation
@wc -l $(SRCFILES) include/*.h > LineCounts.$(ARCH).txt
@echo BUILD_NUM = $$(( $(BUILD_NUM) + 1 )) > Makefile.BuildNum.$(ARCH)
$(POSTBUILD)
+ @cp $(BIN) $(BIN)_
+ @$(STRIP) $(BIN)_
+ @gzip -c $(BIN)_ > $(GZBIN)
+ @$(RM) $(BIN)_
# Assembly Sources
$(OBJDIR)%.ao$(OBJSUFFIX): %.$(AS_SUFFIX) Makefile
csaERROR_NAMES[Regs->int_num], Regs->err_code);
Log_Warning("Arch", "at CS:EIP %04x:%08x",
Regs->cs, Regs->eip);
+ Error_Backtrace(Regs->eip, Regs->ebp);
+
MM_DumpTables(0, KERNEL_BASE);
switch( Regs->int_num )
{
// LogF("Backtrace: %s+0x%x", str, delta);
if(!MM_GetPhysAddr(ebp))
{
- LogF("\nBacktrace: Invalid EBP, stopping\n");
+ LogF("\nBacktrace: Invalid EBP %p, stopping\n", ebp);
return;
}
*/
#define DEBUG 0
#include <acess.h>
+#include <hal_proc.h>
// === IMPORTS ===
extern void Arch_LoadBootModules(void);
// - Execute the Config Script
Log_Log("Config", "Spawning init '%s'", gsInitBinary);
- Proc_Spawn(gsInitBinary);
+ if(Proc_Clone(CLONE_VM|CLONE_NOUSER) == 0)
+ {
+ const char *args[] = {gsInitBinary, 0};
+ Proc_Execve(gsInitBinary, args, &args[1], 0);
+ Log_KernelPanic("System", "Unable to spawn init '%s'", gsInitBinary);
+ }
// Set the debug to be echoed to the terminal
Log_Log("Config", "Kernel now echoes to VT7 (Ctrl-Alt-F8)");
}
// Check if the node has a FindDir method
+ if( !curNode->Type )
+ {
+ LOG("Finddir failure on '%s' - No type", Path);
+ Log_Error("VFS", "Node at '%s' has no type (mount %s:%s)",
+ Path, mnt->Filesystem->Name, mnt->MountPoint);
+ goto _error;
+ }
if( !curNode->Type->FindDir )
{
- LOG("Finddir failure on '%s'", Path);
+ LOG("Finddir failure on '%s' - No FindDir method in %s", Path, curNode->Type->Name);
goto _error;
}
LOG("FindDir{=%p}(%p, '%s')", curNode->Type->FindDir, curNode, pathEle);
_CloseNode(h->Node);
- h->Mount->OpenHandleCount --;
+ if( h->Mount )
+ h->Mount->OpenHandleCount --;
h->Node = NULL;
}
}
$size = filesize($path);
-/*
- $_sym = $prefix."_".$i."_data";
- $fp = fopen($path, "rb");
-
- $gOutput .= "Uint8 $_sym[] = {\n";
- for( $j = 0; $j + 16 < $size; $j += 16 ) {
- $gOutput .= "\t";
- $gOutput .= hd8($fp).",".hd8($fp).",";
- $gOutput .= hd8($fp).",".hd8($fp).",";
- $gOutput .= hd8($fp).",".hd8($fp).",";
- $gOutput .= hd8($fp).",".hd8($fp).",";
- $gOutput .= hd8($fp).",".hd8($fp).",";
- $gOutput .= hd8($fp).",".hd8($fp).",";
- $gOutput .= hd8($fp).",".hd8($fp).",";
- $gOutput .= hd8($fp).",".hd8($fp).",\n";
- }
- $gOutput .= "\t";
- for( ; $j < $size; $j ++ ) {
- if( $j & 15 ) $gOutput .= ",";
- $gOutput .= hd8($fp);
- }
- fclose($fp);
- $gOutput .= "\n};\n";
-*/
-
-//*
$_sym = "_binary_".str_replace(array("/","-","."), "_", $path)."_start";
$gOutput .= "extern Uint8 {$_sym}[];";
$gSymFiles[] = $path;
-//*/
$gOutput .= <<<EOF
tVFS_Node {$prefix}_{$i} = {
.NumACLs = 1,
// === GLOBALS ===
MODULE_DEFINE(0, 0x0A, FS_InitRD, InitRD_Install, NULL);
tVFS_Driver gInitRD_FSInfo = {
- "initrd", 0, InitRD_InitDevice, InitRD_Unmount, InitRD_GetNodeFromINode
+ .Name = "initrd",
+ .InitDevice = InitRD_InitDevice,
+ .Unmount = InitRD_Unmount,
+ .GetNodeFromINode = InitRD_GetNodeFromINode
};
tVFS_NodeType gInitRD_DirType = {
.ReadDir = InitRD_ReadDir,
install: $(BIN)
ifneq ($(BUILDTYPE),static)
- @$(xMKDIR) $(DISTROOT)/Modules/$(ARCH); true
- $(xCP) $(BIN) $(DISTROOT)/Modules/$(ARCH)/$(NAME).kmd
+ @$(xMKDIR) $(DISTROOT)/$(ARCH)/Modules; true
+ @gzip -c $(BIN) > $(BIN).gz
+ $(xCP) $(BIN).gz $(DISTROOT)/$(ARCH)/Modules/$(NAME).kmd.gz
else
endif
#include <stdint.h>
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
#include <net.h>
#define FILENAME_MAX 255
\r
include ../Makefile.tpl\r
\r
-#all: $(OUTPUTDIR)Libs/crt0.o\r
-\r
-# C Runtime 0\r
-#$(OUTPUTDIR)Libs/crt0.o: crt0.asm\r
-# @echo --- $(AS) -o $@\r
-# @$(AS) $(ASFLAGS) -o $@ $<\r