Import backup from 2005-06-21
This commit is contained in:
parent
da90bcc164
commit
2cefd9441c
@ -18,12 +18,17 @@ LD=ld
|
|||||||
LDFLAGS=-nodefaultlibs -nostdlib --no-demangle -T link.ld
|
LDFLAGS=-nodefaultlibs -nostdlib --no-demangle -T link.ld
|
||||||
|
|
||||||
# Files
|
# Files
|
||||||
OBJS=boot.o kernel.o lang/lang_a.o mm/mm.o mm/vmm.o lang/conv.o \
|
OBJS=boot.o lang/lang_a.o \
|
||||||
display/kout.o char/vconsole.o display/display.o devices.o \
|
kernel.o mm/mm.o mm/vmm.o lang/conv.o display/kout.o display/display.o \
|
||||||
sys/pic.o char/keyboard.o block/ramdisk.o fs/vfs.o \
|
sys/pic.o char/keyboard.o lang/lang.o \
|
||||||
lang/lang.o lang/string.o lang/new.o fs/ext2.o char/misc_char.o
|
lang/string.o lang/new.o char/misc_char.o char/vconsole.o \
|
||||||
CSRC=kernel.c mm/mm.c mm/vmm.c lang/conv.c display/kout.c display/display.c sys/pic.c char/keyboard.c lang/lang.c
|
devices.o block/ramdisk.o fs/vfs.o fs/FileSystem.o fs/VFSMount.o \
|
||||||
CXXSRC=lang/string.cpp lang/new.cpp fs/vfs.cpp fs/ext2.cpp char/misc_char.cpp block/ramdisk.cpp char/vconsole.cpp devices.cpp
|
fs/ext2/ext2.o
|
||||||
|
CSRC=kernel.c mm/mm.c mm/vmm.c lang/conv.c display/kout.c display/display.c \
|
||||||
|
sys/pic.c char/keyboard.c lang/lang.c
|
||||||
|
CXXSRC=lang/string.cpp lang/new.cpp char/misc_char.cpp char/vconsole.cpp \
|
||||||
|
block/ramdisk.cpp devices.cpp fs/vfs.cpp fs/FileSystem.o fs/VFSMount.o \
|
||||||
|
fs/ext2/ext2.cpp
|
||||||
|
|
||||||
.PHONY: all depend clean html
|
.PHONY: all depend clean html
|
||||||
|
|
||||||
@ -55,7 +60,7 @@ html:
|
|||||||
kernel.o: kernel.h hos_defines.h multiboot.h module.h lang/lang.h functions.h
|
kernel.o: kernel.h hos_defines.h multiboot.h module.h lang/lang.h functions.h
|
||||||
kernel.o: sys/io.h mm/mm.h mm/vmm.h lang/conv.h devices.h display/display.h
|
kernel.o: sys/io.h mm/mm.h mm/vmm.h lang/conv.h devices.h display/display.h
|
||||||
kernel.o: display/kout.h sys/pic.h char/keyboard.h block/ramdisk.h fs/vfs.h
|
kernel.o: display/kout.h sys/pic.h char/keyboard.h block/ramdisk.h fs/vfs.h
|
||||||
kernel.o: fs/ext2.h fs/vfs.h
|
kernel.o: fs/ext2/ext2.h
|
||||||
mm/mm.o: kernel.h hos_defines.h multiboot.h mm/mm.h
|
mm/mm.o: kernel.h hos_defines.h multiboot.h mm/mm.h
|
||||||
mm/vmm.o: hos_defines.h kernel.h multiboot.h mm/vmm.h lang/lang.h mm/mm.h
|
mm/vmm.o: hos_defines.h kernel.h multiboot.h mm/vmm.h lang/lang.h mm/mm.h
|
||||||
lang/conv.o: lang/conv.h hos_defines.h
|
lang/conv.o: lang/conv.h hos_defines.h
|
||||||
@ -70,14 +75,15 @@ char/keyboard.o: lang/conv.h display/kout.h display/display.h devices.h
|
|||||||
lang/lang.o: lang/lang.h hos_defines.h
|
lang/lang.o: lang/lang.h hos_defines.h
|
||||||
lang/string.o: lang/string.h lang/lang.h hos_defines.h
|
lang/string.o: lang/string.h lang/lang.h hos_defines.h
|
||||||
lang/new.o: hos_defines.h mm/vmm.h multiboot.h
|
lang/new.o: hos_defines.h mm/vmm.h multiboot.h
|
||||||
fs/vfs.o: hos_defines.h display/kout.h fs/vfs.h fs/ext2.h lang/vector.h
|
|
||||||
fs/vfs.o: lang/string.h devices.h
|
|
||||||
fs/ext2.o: fs/ext2.h fs/vfs.h
|
|
||||||
char/misc_char.o: hos_defines.h devices.h char/misc_char.h sys/io.h
|
char/misc_char.o: hos_defines.h devices.h char/misc_char.h sys/io.h
|
||||||
block/ramdisk.o: functions.h hos_defines.h sys/io.h mm/vmm.h multiboot.h
|
|
||||||
block/ramdisk.o: lang/lang.h block/ramdisk.h devices.h
|
|
||||||
char/vconsole.o: hos_defines.h mm/vmm.h multiboot.h lang/lang.h
|
char/vconsole.o: hos_defines.h mm/vmm.h multiboot.h lang/lang.h
|
||||||
char/vconsole.o: display/display.h devices.h functions.h sys/io.h
|
char/vconsole.o: display/display.h devices.h functions.h sys/io.h
|
||||||
char/vconsole.o: char/vconsole.h
|
char/vconsole.o: char/vconsole.h
|
||||||
|
block/ramdisk.o: functions.h hos_defines.h sys/io.h mm/vmm.h multiboot.h
|
||||||
|
block/ramdisk.o: lang/lang.h block/ramdisk.h devices.h
|
||||||
devices.o: hos_defines.h devices.h char/misc_char.h char/misc_char.h
|
devices.o: hos_defines.h devices.h char/misc_char.h char/misc_char.h
|
||||||
devices.o: char/vconsole.h block/ramdisk.h
|
devices.o: char/vconsole.h block/ramdisk.h
|
||||||
|
fs/vfs.o: hos_defines.h display/kout.h fs/vfs.h devices.h lang/string.h
|
||||||
|
fs/vfs.o: fs/ext2/ext2.h fs/vfs.h lang/vector.h
|
||||||
|
fs/ext2/ext2.o: display/kout.h hos_defines.h fs/ext2/ext2.h fs/vfs.h
|
||||||
|
fs/ext2/ext2.o: devices.h
|
||||||
|
@ -18,12 +18,15 @@ LD=ld
|
|||||||
LDFLAGS=-nodefaultlibs -nostdlib --no-demangle -T link.ld
|
LDFLAGS=-nodefaultlibs -nostdlib --no-demangle -T link.ld
|
||||||
|
|
||||||
# Files
|
# Files
|
||||||
OBJS=boot.o kernel.o lang/lang_a.o mm/mm.o mm/vmm.o lang/conv.o \
|
OBJS=boot.o lang/lang_a.o \
|
||||||
display/kout.o char/vconsole.o display/display.o devices.o \
|
kernel.o mm/mm.o mm/vmm.o lang/conv.o display/kout.o display/display.o \
|
||||||
sys/pic.o char/keyboard.o block/ramdisk.o fs/vfs.o \
|
sys/pic.o char/keyboard.o lang/lang.o \
|
||||||
lang/lang.o lang/string.o lang/new.o fs/ext2.o char/misc_char.o
|
lang/string.o lang/new.o char/misc_char.o char/vconsole.o \
|
||||||
CSRC=kernel.c mm/mm.c mm/vmm.c lang/conv.c display/kout.c display/display.c sys/pic.c char/keyboard.c lang/lang.c
|
devices.o block/ramdisk.o fs/vfs.o fs/ext2/ext2.o
|
||||||
CXXSRC=lang/string.cpp lang/new.cpp fs/vfs.cpp fs/ext2.cpp char/misc_char.cpp block/ramdisk.cpp char/vconsole.cpp devices.cpp
|
CSRC=kernel.c mm/mm.c mm/vmm.c lang/conv.c display/kout.c display/display.c \
|
||||||
|
sys/pic.c char/keyboard.c lang/lang.c
|
||||||
|
CXXSRC=lang/string.cpp lang/new.cpp char/misc_char.cpp char/vconsole.cpp \
|
||||||
|
block/ramdisk.cpp devices.cpp fs/vfs.cpp fs/ext2/ext2.cpp
|
||||||
|
|
||||||
.PHONY: all depend clean html
|
.PHONY: all depend clean html
|
||||||
|
|
||||||
@ -55,7 +58,7 @@ html:
|
|||||||
kernel.o: kernel.h hos_defines.h multiboot.h module.h lang/lang.h functions.h
|
kernel.o: kernel.h hos_defines.h multiboot.h module.h lang/lang.h functions.h
|
||||||
kernel.o: sys/io.h mm/mm.h mm/vmm.h lang/conv.h devices.h display/display.h
|
kernel.o: sys/io.h mm/mm.h mm/vmm.h lang/conv.h devices.h display/display.h
|
||||||
kernel.o: display/kout.h sys/pic.h char/keyboard.h block/ramdisk.h fs/vfs.h
|
kernel.o: display/kout.h sys/pic.h char/keyboard.h block/ramdisk.h fs/vfs.h
|
||||||
kernel.o: fs/ext2.h fs/vfs.h
|
kernel.o: fs/ext2/ext2.h
|
||||||
mm/mm.o: kernel.h hos_defines.h multiboot.h mm/mm.h
|
mm/mm.o: kernel.h hos_defines.h multiboot.h mm/mm.h
|
||||||
mm/vmm.o: hos_defines.h kernel.h multiboot.h mm/vmm.h lang/lang.h mm/mm.h
|
mm/vmm.o: hos_defines.h kernel.h multiboot.h mm/vmm.h lang/lang.h mm/mm.h
|
||||||
lang/conv.o: lang/conv.h hos_defines.h
|
lang/conv.o: lang/conv.h hos_defines.h
|
||||||
@ -70,14 +73,15 @@ char/keyboard.o: lang/conv.h display/kout.h display/display.h devices.h
|
|||||||
lang/lang.o: lang/lang.h hos_defines.h
|
lang/lang.o: lang/lang.h hos_defines.h
|
||||||
lang/string.o: lang/string.h lang/lang.h hos_defines.h
|
lang/string.o: lang/string.h lang/lang.h hos_defines.h
|
||||||
lang/new.o: hos_defines.h mm/vmm.h multiboot.h
|
lang/new.o: hos_defines.h mm/vmm.h multiboot.h
|
||||||
fs/vfs.o: hos_defines.h display/kout.h fs/vfs.h fs/ext2.h lang/vector.h
|
|
||||||
fs/vfs.o: lang/string.h devices.h
|
|
||||||
fs/ext2.o: fs/ext2.h fs/vfs.h
|
|
||||||
char/misc_char.o: hos_defines.h devices.h char/misc_char.h sys/io.h
|
char/misc_char.o: hos_defines.h devices.h char/misc_char.h sys/io.h
|
||||||
block/ramdisk.o: functions.h hos_defines.h sys/io.h mm/vmm.h multiboot.h
|
|
||||||
block/ramdisk.o: lang/lang.h block/ramdisk.h devices.h
|
|
||||||
char/vconsole.o: hos_defines.h mm/vmm.h multiboot.h lang/lang.h
|
char/vconsole.o: hos_defines.h mm/vmm.h multiboot.h lang/lang.h
|
||||||
char/vconsole.o: display/display.h devices.h functions.h sys/io.h
|
char/vconsole.o: display/display.h devices.h functions.h sys/io.h
|
||||||
char/vconsole.o: char/vconsole.h
|
char/vconsole.o: char/vconsole.h
|
||||||
|
block/ramdisk.o: functions.h hos_defines.h sys/io.h mm/vmm.h multiboot.h
|
||||||
|
block/ramdisk.o: lang/lang.h block/ramdisk.h devices.h
|
||||||
devices.o: hos_defines.h devices.h char/misc_char.h char/misc_char.h
|
devices.o: hos_defines.h devices.h char/misc_char.h char/misc_char.h
|
||||||
devices.o: char/vconsole.h block/ramdisk.h
|
devices.o: char/vconsole.h block/ramdisk.h
|
||||||
|
fs/vfs.o: hos_defines.h display/kout.h fs/vfs.h devices.h lang/string.h
|
||||||
|
fs/vfs.o: fs/ext2/ext2.h lang/vector.h
|
||||||
|
fs/ext2/ext2.o: display/kout.h hos_defines.h fs/ext2/ext2.h fs/vfs.h
|
||||||
|
fs/ext2/ext2.o: devices.h lang/string.h
|
||||||
|
19
kernel/fs/FileSystem.cpp
Normal file
19
kernel/fs/FileSystem.cpp
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// FileSystem.cpp
|
||||||
|
// Virtual file system subsystem for HOS
|
||||||
|
// Author: Josh Holtrop
|
||||||
|
// Date: 06/21/05
|
||||||
|
// Modified: 06/21/05
|
||||||
|
|
||||||
|
#include "FileSystem.h"
|
||||||
|
#include "hos_defines.h"
|
||||||
|
|
||||||
|
FileSystem::FileSystem() {myError = -10278;}
|
||||||
|
FileSystem::~FileSystem() {}
|
||||||
|
u32_t FileSystem::totalBlocks(){return 0;}
|
||||||
|
u32_t FileSystem::usedBlocks(){return 0;};
|
||||||
|
u32_t FileSystem::freeBlocks(){return 0;};
|
||||||
|
u32_t FileSystem::totalInodes(){return 0;};
|
||||||
|
u32_t FileSystem::usedInodes(){return 0;};
|
||||||
|
u32_t FileSystem::freeInodes(){return 0;};
|
||||||
|
u32_t FileSystem::getRootInodeNumber(){return 0;};
|
||||||
|
int FileSystem::check(){return myError;};
|
36
kernel/fs/FileSystem.h
Normal file
36
kernel/fs/FileSystem.h
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
// FileSystem.h
|
||||||
|
// Virtual file system subsystem for HOS
|
||||||
|
// Author: Josh Holtrop
|
||||||
|
// Date: 06/21/05
|
||||||
|
// Modified: 06/21/05
|
||||||
|
|
||||||
|
#ifndef __HOS_FILESYSTEM__
|
||||||
|
#define __HOS_FILESYSTEM__ __HOS_FILESYSTEM__
|
||||||
|
|
||||||
|
#include "devices.h"
|
||||||
|
#include "hos_defines.h"
|
||||||
|
|
||||||
|
class FileSystem
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
int myError;
|
||||||
|
device_t myDevice;
|
||||||
|
public:
|
||||||
|
FileSystem();
|
||||||
|
FileSystem(device_t dev);
|
||||||
|
virtual ~FileSystem();
|
||||||
|
|
||||||
|
virtual u32_t totalBlocks(); /* 512 byte blocks */
|
||||||
|
virtual u32_t usedBlocks();
|
||||||
|
virtual u32_t freeBlocks();
|
||||||
|
|
||||||
|
virtual u32_t totalInodes();
|
||||||
|
virtual u32_t usedInodes();
|
||||||
|
virtual u32_t freeInodes();
|
||||||
|
|
||||||
|
virtual u32_t getRootInodeNumber();
|
||||||
|
|
||||||
|
virtual int check();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
35
kernel/fs/VFSMount.cpp
Normal file
35
kernel/fs/VFSMount.cpp
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
// VFSMount.cpp
|
||||||
|
// Virtual file system subsystem for HOS
|
||||||
|
// Author: Josh Holtrop
|
||||||
|
// Date: 06/21/05
|
||||||
|
// Modified: 06/21/05
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include "display/kout.h"
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "VFSMount.h"
|
||||||
|
#include "hos_defines.h"
|
||||||
|
#include "devices.h"
|
||||||
|
#include "lang/string.h"
|
||||||
|
#include "fs/vfs.h"
|
||||||
|
|
||||||
|
VFSMount::VFSMount(device_t dev, FileSystem *fs, string mountPoint, inode_num_t mountInode)
|
||||||
|
{
|
||||||
|
myDev = dev;
|
||||||
|
myFS = fs;
|
||||||
|
myRefs = 0;
|
||||||
|
myMountPoint = mountPoint;
|
||||||
|
myMountInode = mountInode;
|
||||||
|
}
|
||||||
|
|
||||||
|
VFSMount::~VFSMount()
|
||||||
|
{
|
||||||
|
if (myFS)
|
||||||
|
{
|
||||||
|
delete myFS;
|
||||||
|
if (myRefs)
|
||||||
|
kprintf("Filesystem uncleanly mounted from %s\n", myMountPoint.data());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
29
kernel/fs/VFSMount.h
Normal file
29
kernel/fs/VFSMount.h
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
// VFSMount.h
|
||||||
|
// Virtual file system subsystem for HOS
|
||||||
|
// Author: Josh Holtrop
|
||||||
|
// Date: 06/21/05
|
||||||
|
// Modified: 06/21/05
|
||||||
|
|
||||||
|
#ifndef __HOS_VFSMOUNT__
|
||||||
|
#define __HOS_VFSMOUNT__ __HOS_VFSMOUNT__
|
||||||
|
|
||||||
|
#include "lang/string.h"
|
||||||
|
#include "devices.h"
|
||||||
|
#include "FileSystem.h"
|
||||||
|
#include "fs/vfs.h"
|
||||||
|
|
||||||
|
class VFSMount
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
device_t myDev;
|
||||||
|
FileSystem *myFS;
|
||||||
|
int myRefs;
|
||||||
|
string myMountPoint;
|
||||||
|
inode_num_t myMountInode;
|
||||||
|
|
||||||
|
public:
|
||||||
|
VFSMount(device_t dev, FileSystem *fs, string mountPoint, inode_num_t mountInode);
|
||||||
|
~VFSMount();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -1,72 +0,0 @@
|
|||||||
// devices.c
|
|
||||||
// Author: Josh Holtrop
|
|
||||||
// Date: 08/02/04
|
|
||||||
// Modified: 08/16/04
|
|
||||||
|
|
||||||
|
|
||||||
#include "fs/devices.h"
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "char/parallel.h"
|
|
||||||
#include "char/vconsole.h"
|
|
||||||
#include "block/ramdisk.h"
|
|
||||||
|
|
||||||
dev_driver_t *drivers[2][256];
|
|
||||||
|
|
||||||
|
|
||||||
// initialization routine for devices subsystem
|
|
||||||
void devices_init()
|
|
||||||
{
|
|
||||||
parallel_init(MAJORC_PARALLEL);
|
|
||||||
vconsole_init(MAJORC_VCONSOLE);
|
|
||||||
ramdisk_init(MAJORB_RAMDISK);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int devices_register_major(char type, major_t major, dev_driver_t *dev)
|
|
||||||
{
|
|
||||||
int idx;
|
|
||||||
if (type == 'b')
|
|
||||||
idx = 0;
|
|
||||||
else if (type == 'c')
|
|
||||||
idx = 1;
|
|
||||||
else
|
|
||||||
return -1;
|
|
||||||
if (drivers[idx][major])
|
|
||||||
return -2; //driver already registered
|
|
||||||
drivers[idx][major] = dev;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int block_read(major_t major, minor_t minor, u32_t blockStart, u32_t blocks, void *buffer)
|
|
||||||
{
|
|
||||||
if (drivers[0][major] && drivers[0][major]->block_read)
|
|
||||||
return drivers[0][major]->block_read(minor, blockStart, blocks, buffer);
|
|
||||||
return INT_MIN;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int block_write(major_t major, minor_t minor, u32_t blockStart, u32_t blocks, void *buffer)
|
|
||||||
{
|
|
||||||
if (drivers[0][major] && drivers[0][major]->block_write)
|
|
||||||
return drivers[0][major]->block_write(minor, blockStart, blocks, buffer);
|
|
||||||
return INT_MIN;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int char_read(major_t major, minor_t minor)
|
|
||||||
{
|
|
||||||
if (drivers[1][major] && drivers[1][major]->char_read)
|
|
||||||
return drivers[1][major]->char_read(minor);
|
|
||||||
return INT_MIN;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int char_write(major_t major, minor_t minor, int c)
|
|
||||||
{
|
|
||||||
if (drivers[1][major] && drivers[1][major]->char_write)
|
|
||||||
return drivers[1][major]->char_write(minor, c);
|
|
||||||
return INT_MIN;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
|||||||
// devices.h
|
|
||||||
// Author: Josh Holtrop
|
|
||||||
// Date: 08/02/04
|
|
||||||
// Modified: 08/22/04
|
|
||||||
|
|
||||||
#ifndef __HOS_DEVICES_H__
|
|
||||||
#define __HOS_DEVICES_H__ __HOS_DEVICES_H__
|
|
||||||
|
|
||||||
#include "hos_defines.h"
|
|
||||||
|
|
||||||
#define MAJORC_VCONSOLE 4
|
|
||||||
#define MAJORC_PARALLEL 6
|
|
||||||
#define MAJORC_KEYBOARD 11
|
|
||||||
|
|
||||||
#define MAJORB_RAMDISK 1
|
|
||||||
|
|
||||||
#define BLOCK_SIZE 512
|
|
||||||
#define BLOCK_SIZE_LOG 9
|
|
||||||
|
|
||||||
typedef short major_t;
|
|
||||||
typedef short minor_t;
|
|
||||||
typedef unsigned int device_t;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
int (*block_read)(minor_t minor, u32_t blockStart, u32_t blocks, void *buffer);
|
|
||||||
int (*block_write)(minor_t minor, u32_t blockStart, u32_t blocks, void *buffer);
|
|
||||||
int (*char_read)(minor_t minor);
|
|
||||||
int (*char_write)(minor_t minor, int c);
|
|
||||||
} dev_driver_t;
|
|
||||||
|
|
||||||
void devices_init();
|
|
||||||
int devices_register_major(char type, major_t major, dev_driver_t *dev);
|
|
||||||
|
|
||||||
int block_read(major_t major, minor_t minor, u32_t blockStart, u32_t blocks, void *buffer);
|
|
||||||
int block_write(major_t major, minor_t minor, u32_t blockStart, u32_t blocks, void *buffer);
|
|
||||||
int char_read(major_t major, minor_t minor);
|
|
||||||
int char_write(major_t major, minor_t minor, int c);
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -59,7 +59,7 @@
|
|||||||
#define EXT2_FT_SYMLINK 7
|
#define EXT2_FT_SYMLINK 7
|
||||||
#define EXT2_FT_MAX 8
|
#define EXT2_FT_MAX 8
|
||||||
|
|
||||||
#include "vfs.h"
|
#include "fs/vfs.h"
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
@ -12,7 +12,9 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#include "vfs.h"
|
#include "vfs.h"
|
||||||
#include "ext2.h"
|
#include "fs/FileSystem.h"
|
||||||
|
#include "fs/VFSMount.h"
|
||||||
|
#include "fs/ext2/ext2.h"
|
||||||
#include "lang/vector.h"
|
#include "lang/vector.h"
|
||||||
#include "lang/string.h"
|
#include "lang/string.h"
|
||||||
#include "devices.h"
|
#include "devices.h"
|
||||||
@ -69,33 +71,3 @@ FileSystem *vfs_attempt_mount(device_t device, int fsType)
|
|||||||
return fs;
|
return fs;
|
||||||
}
|
}
|
||||||
|
|
||||||
VFSMount::VFSMount(device_t dev, FileSystem *fs, string mountPoint, inode_num_t mountInode)
|
|
||||||
{
|
|
||||||
myDev = dev;
|
|
||||||
myFS = fs;
|
|
||||||
myRefs = 0;
|
|
||||||
myMountPoint = mountPoint;
|
|
||||||
myMountInode = mountInode;
|
|
||||||
}
|
|
||||||
|
|
||||||
VFSMount::~VFSMount()
|
|
||||||
{
|
|
||||||
if (myFS)
|
|
||||||
{
|
|
||||||
delete myFS;
|
|
||||||
if (myRefs)
|
|
||||||
kprintf("Filesystem uncleanly mounted from %s\n", myMountPoint.data());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FileSystem::FileSystem() {myError = -10278;}
|
|
||||||
FileSystem::~FileSystem() {}
|
|
||||||
u32_t FileSystem::totalBlocks(){return 0;}
|
|
||||||
u32_t FileSystem::usedBlocks(){return 0;};
|
|
||||||
u32_t FileSystem::freeBlocks(){return 0;};
|
|
||||||
u32_t FileSystem::totalInodes(){return 0;};
|
|
||||||
u32_t FileSystem::usedInodes(){return 0;};
|
|
||||||
u32_t FileSystem::freeInodes(){return 0;};
|
|
||||||
u32_t FileSystem::getRootInodeNumber(){return 0;};
|
|
||||||
int FileSystem::check(){return myError;};
|
|
||||||
|
|
||||||
|
@ -50,43 +50,8 @@ int vfs_mount(device_t device, int fsType, char *mountPoint);
|
|||||||
}
|
}
|
||||||
|
|
||||||
#include "lang/string.h"
|
#include "lang/string.h"
|
||||||
|
#include "fs/FileSystem.h"
|
||||||
class FileSystem
|
#include "fs/VFSMount.h"
|
||||||
{
|
|
||||||
protected:
|
|
||||||
int myError;
|
|
||||||
device_t myDevice;
|
|
||||||
public:
|
|
||||||
FileSystem();
|
|
||||||
FileSystem(device_t dev);
|
|
||||||
virtual ~FileSystem();
|
|
||||||
|
|
||||||
virtual u32_t totalBlocks(); /* 512 byte blocks */
|
|
||||||
virtual u32_t usedBlocks();
|
|
||||||
virtual u32_t freeBlocks();
|
|
||||||
|
|
||||||
virtual u32_t totalInodes();
|
|
||||||
virtual u32_t usedInodes();
|
|
||||||
virtual u32_t freeInodes();
|
|
||||||
|
|
||||||
virtual u32_t getRootInodeNumber();
|
|
||||||
|
|
||||||
virtual int check();
|
|
||||||
};
|
|
||||||
|
|
||||||
class VFSMount
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
device_t myDev;
|
|
||||||
FileSystem *myFS;
|
|
||||||
int myRefs;
|
|
||||||
string myMountPoint;
|
|
||||||
inode_num_t myMountInode;
|
|
||||||
|
|
||||||
public:
|
|
||||||
VFSMount(device_t dev, FileSystem *fs, string mountPoint, inode_num_t mountInode);
|
|
||||||
~VFSMount();
|
|
||||||
};
|
|
||||||
|
|
||||||
FileSystem *vfs_attempt_mount(device_t device, int fsType);
|
FileSystem *vfs_attempt_mount(device_t device, int fsType);
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include "char/keyboard.h"
|
#include "char/keyboard.h"
|
||||||
#include "block/ramdisk.h"
|
#include "block/ramdisk.h"
|
||||||
#include "fs/vfs.h"
|
#include "fs/vfs.h"
|
||||||
#include "fs/ext2.h"
|
#include "fs/ext2/ext2.h"
|
||||||
|
|
||||||
mb_info_t mb_info_block;
|
mb_info_t mb_info_block;
|
||||||
mb_mmap_t mb_mmap[MAX_MMAP];
|
mb_mmap_t mb_mmap[MAX_MMAP];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user