K_OBJ += vfs/fs/root.o vfs/fs/devfs.o
K_OBJ += drvutil_disk.o drv/proc.o
# Modules
-MODULES := Storage/LVM Filesystems/FAT Filesystems/Ext2
+MODULES := Storage/LVM Filesystems/FAT Filesystems/Ext2 Filesystems/NTFS
# Local kernel soruces (same as above, but located in same directory as Makefile)
L_OBJ = vfs_handles.o threads.o nativefs.o time.o actions.o
# Native Sources (compiled as usual)
int DiskTool_RegisterLVM(const char *Identifier, const char *Path)
{
int fd = DiskTool_int_TranslateOpen(Path, VFS_OPENFLAG_READ|VFS_OPENFLAG_WRITE);
- if(fd == -1)
+ if(fd == -1) {
+ Log_Notice("DiskTool", "Can't open '%s' for LVM %s", Path, Identifier);
return -1;
+ }
VFS_Seek(fd, 0, SEEK_END);
LVM_AddVolume( &gDiskTool_VolumeType, Identifier, (void*)(tVAddr)fd, 512, VFS_Tell(fd)/512);
+ Log_Debug("DiskTool", "Registered '%s' for LVM %s", Path, Identifier);
return 0;
}
// Call mount
VFS_MkDir(mountpoint);
// TODO: Detect filesystem?
- return VFS_Mount(tpath, mountpoint, "fat", "");
+ return VFS_Mount(tpath, mountpoint, "", "");
}
int DiskTool_Copy(const char *Source, const char *Destination)
int DiskTool_LVM_Read(void *Handle, Uint64 Block, size_t BlockCount, void *Dest)
{
- VFS_ReadAt( (int)(tVAddr)Handle, Block*512, BlockCount*512, Dest);
- return 0;
+ return VFS_ReadAt( (int)(tVAddr)Handle, Block*512, BlockCount*512, Dest) / 512;
}
int DiskTool_LVM_Write(void *Handle, Uint64 Block, size_t BlockCount, const void *Dest)
{
- VFS_WriteAt( (int)(tVAddr)Handle, Block*512, BlockCount*512, Dest);
- return 0;
+ return VFS_WriteAt( (int)(tVAddr)Handle, Block*512, BlockCount*512, Dest) / 512;
}
void DiskTool_LVM_Cleanup(void *Handle)
{
#include <stdint.h>
#include <acess_logging.h>
#include <ctype.h>
+#include <inttypes.h>
#define LOGHDR(col,type) fprintf(stderr, "\e["col"m[%-8.8s]"type" ", Ident)
#define LOGTAIL() fprintf(stderr, "\e[0m\n")
// === CODE ===
void Log_KernelPanic(const char *Ident, const char *Message, ...) {
PUTERR("35", "k")
- exit(-1);
+ abort();
}
void Log_Panic(const char *Ident, const char *Message, ...)
PUTERR("34", "p")
case 'x':
fprintf(stderr, "0x%x", va_arg(args,unsigned int));
break;
+ case 'X':
+ fprintf(stderr, "0x%"PRIx64, va_arg(args,uint64_t));
+ break;
default:
va_arg(args,uintptr_t);
fprintf(stderr, "?");
case 'x':
fprintf(stderr, " 0x%x", va_arg(args, unsigned int));
break;
+ case 'X':
+ fprintf(stderr, " 0x%"PRIx64, va_arg(args,uint64_t));
+ break;
case 's':
fprintf(stderr, " \"%s\"", va_arg(args, const char *));
break;