Import backup from 2004-06-08

This commit is contained in:
Josh Holtrop 2004-06-08 22:00:00 -04:00
parent 802a07ebfe
commit fdf6b71a91
12 changed files with 222 additions and 138 deletions

View File

@ -12,6 +12,8 @@
#define KBD_BUFFER_LENGTH 64
extern "C" {
byte kbdFlags = 0; //holds current keyboard flags - caps/num/scroll/shift/ctrl/alt
byte kbdAscii = 0; //holds ASCII value of a key pressed
byte kbdScan = 0; //holds the keyboard scan code of a key pressed
@ -244,7 +246,7 @@ void kbd_resetLEDs()
}
}

View File

@ -40,11 +40,14 @@
//====PROTOTYPES:
extern "C" {
void isr_keyboard();
void kbd_resetLEDs();
dword kbdGetKey();
dword kbdWaitKey();
}
#endif

View File

@ -10,6 +10,8 @@
#define MOUSE_BUFFER_LENGTH 16
extern "C" {
int mouse_x;
int mouse_y;
int mouse_bytesRead;
@ -70,5 +72,5 @@ void isr_mouse()
}

View File

@ -6,10 +6,12 @@
#ifndef __HOS_MOUSE__
#define __HOS_MOUSE__ __HOS_MOUSE__
extern "C" {
void mouse_init();
void isr_mouse();
}
#endif

View File

@ -3,8 +3,53 @@
// Device object for use in devfs
// Author: Josh Holtrop
// Date: 06/03/04
// Modified: 06/03/04
// Modified: 06/08/04
#include "Device.h"
#include "DeviceFolder.h"
#include "hos_defines.h"
#include "lang/string.h"
Device::Device()
{
major = minor = permissions = 0;
}
Device::Device(string aname)
{
major = minor = permissions = 0;
name = aname;
}
//Types:
// l = link, call setLink()
// d = directory, automatically initializes a new DeviceFolder object
// b = block device
// c = char device
Device::Device(string aname, dword amajor, dword aminor, char atype, word apermissions)
{
name = aname;
permissions = apermissions;
type = atype;
switch (type)
{
case 'd':
folder = new DeviceFolder();
break;
case 'l':
break;
case 'b':
case 'c':
major = amajor;
minor = aminor;
break;
}
}
void Device::setLink(string alink)
{
if (type == 'l')
link = new string(alink);
}

View File

@ -3,7 +3,7 @@
// Device object for use in devfs
// Author: Josh Holtrop
// Date: 06/03/04
// Modified: 06/03/04
// Modified: 06/08/04
#ifndef __HOS_DEVICE__
#define __HOS_DEVICE__ __HOS_DEVICE__
@ -19,19 +19,23 @@
class Device
{
private:
public:
string name;
union
{
dword myMajor;
LinkedList<Device> *folder;
dword major;
//can't be DeviceFolder * because not then Device & DeviceFolder are inter-dependent
void *folder;
string *link;
};
dword myMinor;
word permissions; //9-bit permissions | (type << 12)
string myName;
public:
// Device();
// Device(string name, dword major, dword minor, char type);
dword minor;
word permissions;
char type;
Device();
Device(string aname);
Device(string aname, dword amajor, dword aminor, char atype, word apermissions);
void setLink(string alink);
};
#endif

View File

@ -9,3 +9,32 @@
#include "Device.h"
#include "lang/LinkedList.h"
DeviceFolder::DeviceFolder()
{
}
int Device::addDevice(Device dev)
{
}
int Device::mkdir(string name, word permissions)
{
Device dev(name, 0, 0, 'd', permissions);
return addDevice(dev);
}
int Device::mklink(string name, string link)
{
Device dev(name, 0, 0, 'l', 0777);
dev.setLink(link);
return addDevice(dev);
}
int Device::mknod(string name, dword major, dword minor, char type, word permissions)
{
Device dev(name, major, minor, type, permissions);
return addDevice(dev);
}

View File

@ -13,10 +13,14 @@
class DeviceFolder
{
public:
private:
LinkedList<Device> devices;
LinkedList<DeviceFolder> folders;
// DeviceFolder();
int addDevice(Device name);
public:
DeviceFolder();
int mkdir(string name, word permissions);
int mklink(string name, string link);
int mknod(string name, dword major, dword minor, char type, word permissions);
};
#endif

View File

@ -3,17 +3,19 @@
// device filesystem for HOS
// Author: Josh Holtrop
// Date: 06/03/04
// Modified: 06/03/04
// Modified: 06/08/04
#include "devfs.h"
#include "Device.h"
#include "DeviceFolder.h"
#include "kio.h"
DeviceFolder *dev;
void devfs_init()
void devfs_init(string mountPoint)
{
dev = new DeviceFolder();
// vfs_mount("devfs", mountPoint, 0755, 0, 0);
}

View File

@ -3,14 +3,15 @@
// device filesystem for HOS
// Author: Josh Holtrop
// Date: 06/03/04
// Modified: 06/03/04
// Modified: 06/08/04
#ifndef __HOS_DEVFS__
#define __HOS_DEVFS__ __HOS_DEVFS__
#include "Device.h"
#include "DeviceFolder.h"
void devfs_init();
void devfs_init(string mountPoint);
#endif

View File

@ -12,12 +12,16 @@
#include "lang/string.h"
#include "devfs.h"
#include "kio.h"
//#include "DeviceFolder.h"
//LinkedList<Mount> mntList;
//LinkedList<Mount> *mntList;
void vfs_init()
{
printf("%u\n", sizeof(string));
//mntList = new LinkedList<Mount>;
printf("%u\n", sizeof(Device));
printf("%u\n", sizeof(DeviceFolder));
devfs_init("/dev");
}

View File

@ -7,7 +7,7 @@ Name Origin Length Attributes
Linker script and memory map
.text 0x00000000c0106000 0x4000
.text 0x00000000c0106000 0x5000
0x00000000c0106000 code = .
0x00000000c0106000 _code = .
0x00000000c0106000 __code = .
@ -39,10 +39,10 @@ Linker script and memory map
0x00000000c01068af _write_cr3
0x00000000c01068ab _read_cr0
.text 0x00000000c0106ba8 0x69a keyboard.o
0x00000000c01070dc __Z9kbdGetKeyv
0x00000000c0107172 __Z13kbd_resetLEDsv
0x00000000c010712e __Z10kbdWaitKeyv
0x00000000c0106ba8 __Z12isr_keyboardv
0x00000000c01070dc _kbdGetKey
0x00000000c0107172 _kbd_resetLEDs
0x00000000c0106ba8 _isr_keyboard
0x00000000c010712e _kbdWaitKey
*fill* 0x00000000c0107242 0x2 00
.text 0x00000000c0107244 0x665 kio.o
0x00000000c01077f4 _kio_drawConsoleChar
@ -66,8 +66,8 @@ Linker script and memory map
0x00000000c0107b80 __Z10mm_freememv
0x00000000c0107bf2 __Z15mm_getTotalMegsv
.text 0x00000000c0107bfc 0x201 mouse.o
0x00000000c0107bfc __Z10mouse_initv
0x00000000c0107ca6 __Z9isr_mousev
0x00000000c0107bfc _mouse_init
0x00000000c0107ca6 _isr_mouse
*fill* 0x00000000c0107dfd 0x3 00
.text 0x00000000c0107e00 0x8f stdfont.o
0x00000000c0107e60 __Z17stdfont_getBitmapj
@ -184,128 +184,114 @@ Linker script and memory map
0x00000000c0109f42 __Znaj
0x00000000c0109f2c __Znwj
0x00000000c0109f6e __ZdaPv
.text 0x00000000c0109f84 0x1a vfs.o
.text 0x00000000c0109f84 0x5e vfs.o
0x00000000c0109f84 __Z8vfs_initv
*fill* 0x00000000c0109f9e 0x2 00
.text 0x00000000c0109fa0 0x2d devfs.o
0x00000000c0109fa0 __Z10devfs_initv
*fill* 0x00000000c0109fcd 0x3 00
0x00000000c010a000 . = ALIGN (0x1000)
*fill* 0x00000000c0109fd0 0x80b237400000030 00
.gnu.linkonce.t._ZN12DeviceFolderC1Ev
0x00000000c010a000 0x28
.gnu.linkonce.t._ZN12DeviceFolderC1Ev
0x00000000c010a000 0x28 devfs.o
0x00000000c010a000 __ZN12DeviceFolderC1Ev
*fill* 0x00000000c0109fe2 0x2 00
.text 0x00000000c0109fe4 0x2d devfs.o
0x00000000c0109fe4 __Z10devfs_init6string
*fill* 0x00000000c010a011 0x3 00
.text 0x00000000c010a014 0x1e5 Device.o
0x00000000c010a07c __ZN6DeviceC2E6stringjjct
0x00000000c010a048 __ZN6DeviceC1Ev
0x00000000c010a014 __ZN6DeviceC2Ev
0x00000000c010a1c0 __ZN6Device7setLinkE6string
0x00000000c010a11e __ZN6DeviceC1E6stringjjct
*fill* 0x00000000c010a1f9 0x3 00
.text 0x00000000c010a1fc 0x2c DeviceFolder.o
0x00000000c010a1fc __ZN12DeviceFolderC2Ev
0x00000000c010a212 __ZN12DeviceFolderC1Ev
0x00000000c010b000 . = ALIGN (0x1000)
*fill* 0x00000000c010a228 0x80b237400000dd8 00
.gnu.linkonce.t._ZN10LinkedListI6DeviceEC1Ev
0x00000000c010a028 0x43
0x00000000c010b000 0x43
.gnu.linkonce.t._ZN10LinkedListI6DeviceEC1Ev
0x00000000c010a028 0x43 devfs.o
0x00000000c010a028 __ZN10LinkedListI6DeviceEC1Ev
.gnu.linkonce.t._ZN10LinkedListI12DeviceFolderEC1Ev
0x00000000c010a06c 0x43
.gnu.linkonce.t._ZN10LinkedListI12DeviceFolderEC1Ev
0x00000000c010a06c 0x43 devfs.o
0x00000000c010a06c __ZN10LinkedListI12DeviceFolderEC1Ev
0x00000000c010b000 0x43 DeviceFolder.o
0x00000000c010b000 __ZN10LinkedListI6DeviceEC1Ev
.gnu.linkonce.t._ZN10LinkedListI6DeviceE10LinkedNodeC1Ev
0x00000000c010a0b0 0x2a
0x00000000c010b044 0x2a
.gnu.linkonce.t._ZN10LinkedListI6DeviceE10LinkedNodeC1Ev
0x00000000c010a0b0 0x2a devfs.o
0x00000000c010a0b0 __ZN10LinkedListI6DeviceE10LinkedNodeC1Ev
0x00000000c010b044 0x2a DeviceFolder.o
0x00000000c010b044 __ZN10LinkedListI6DeviceE10LinkedNodeC1Ev
.gnu.linkonce.t._ZN10LinkedListI12DeviceFolderE10LinkedNodeC1Ev
0x00000000c010a0da 0x2a
.gnu.linkonce.t._ZN10LinkedListI12DeviceFolderE10LinkedNodeC1Ev
0x00000000c010a0da 0x2a devfs.o
0x00000000c010a0da __ZN10LinkedListI12DeviceFolderE10LinkedNodeC1Ev
.gnu.linkonce.t._ZN6DeviceC1Ev
0x00000000c010a104 0x1a
.gnu.linkonce.t._ZN6DeviceC1Ev
0x00000000c010a104 0x1a devfs.o
0x00000000c010a104 __ZN6DeviceC1Ev
.data 0x00000000c010a120 0xee0
0x00000000c010a120 data = .
0x00000000c010a120 _data = .
0x00000000c010a120 __data = .
.data 0x00000000c010b070 0xf90
0x00000000c010b070 data = .
0x00000000c010b070 _data = .
0x00000000c010b070 __data = .
*(.data)
.data 0x00000000c010a120 0x18 stdfont.o
0x00000000c010a120 _fonts
.data 0x00000000c010a138 0x10 video.o
0x00000000c010a138 _vid_ptr16
0x00000000c010a144 _video_psetp
0x00000000c010a140 _vid_ptr32
0x00000000c010a13c _vid_ptr24
.data 0x00000000c010a148 0x4 vmm.o
0x00000000c010a148 _firstHeapEntry
0x00000000c010b000 . = ALIGN (0x1000)
*fill* 0x00000000c010a14c 0x8117cc000000eb4 00
.data 0x00000000c010b070 0x18 stdfont.o
0x00000000c010b070 _fonts
.data 0x00000000c010b088 0x10 video.o
0x00000000c010b088 _vid_ptr16
0x00000000c010b094 _video_psetp
0x00000000c010b090 _vid_ptr32
0x00000000c010b08c _vid_ptr24
.data 0x00000000c010b098 0x4 vmm.o
0x00000000c010b098 _firstHeapEntry
0x00000000c010c000 . = ALIGN (0x1000)
*fill* 0x00000000c010b09c 0x80b989800000f64 00
.rodata 0x00000000c010b000 0x2000
0x00000000c010b000 rodata = .
0x00000000c010b000 _rodata = .
0x00000000c010b000 __rodata = .
.rodata 0x00000000c010c000 0x2000
0x00000000c010c000 rodata = .
0x00000000c010c000 _rodata = .
0x00000000c010c000 __rodata = .
*(.rodata)
.rodata 0x00000000c010b000 0x121 kernel.o
*fill* 0x00000000c010b121 0x1f 00
.rodata 0x00000000c010b140 0x141 keyboard.o
*fill* 0x00000000c010b281 0x3 00
.rodata 0x00000000c010b284 0x1e4 kio.o
*fill* 0x00000000c010b468 0x18 00
.rodata 0x00000000c010b480 0x1200 stdfont.o
.rodata 0x00000000c010c680 0x4 vfs.o
0x00000000c010d000 . = ALIGN (0x1000)
*fill* 0x00000000c010c684 0x8117d140000097c 00
.rodata 0x00000000c010c000 0x121 kernel.o
*fill* 0x00000000c010c121 0x1f 00
.rodata 0x00000000c010c140 0x141 keyboard.o
*fill* 0x00000000c010c281 0x3 00
.rodata 0x00000000c010c284 0x1e4 kio.o
*fill* 0x00000000c010c468 0x18 00
.rodata 0x00000000c010c480 0x1200 stdfont.o
.rodata 0x00000000c010d680 0x9 vfs.o
0x00000000c010e000 . = ALIGN (0x1000)
*fill* 0x00000000c010d689 0x80b98ec00000977 00
.bss 0x00000000c010d000 0x22000
0x00000000c010d000 bss = .
0x00000000c010d000 _bss = .
0x00000000c010d000 __bss = .
.bss 0x00000000c010e000 0x22000
0x00000000c010e000 bss = .
0x00000000c010e000 _bss = .
0x00000000c010e000 __bss = .
*(.bss)
.bss 0x00000000c010d000 0x4 kernel.o
0x00000000c010d000 _timer
*fill* 0x00000000c010d004 0x4 00
*fill* 0x00000000c010d008 0x18 00
.bss 0x00000000c010d020 0x12b keyboard.o
0x00000000c010d040 _kbdBuffer
0x00000000c010d148 _kbdExt
0x00000000c010d021 _kbdAscii
0x00000000c010d149 _kbdExt2
0x00000000c010d14a _ackReason
0x00000000c010d140 _kbdBufferStart
0x00000000c010d022 _kbdScan
0x00000000c010d144 _kbdBufferLen
0x00000000c010d020 _kbdFlags
*fill* 0x00000000c010d14b 0x15 00
.bss 0x00000000c010d160 0xfc0 kio.o
0x00000000c010d180 _console_memory
0x00000000c010d160 _graphical
0x00000000c010d164 _cursorPosition
.bss 0x00000000c010e120 0x20020 mm.o
0x00000000c010e124 _mm_megabytes
0x00000000c010e140 _page_bitmap
0x00000000c010e120 _mm_totalmem
.bss 0x00000000c012e140 0x1c mouse.o
0x00000000c012e144 _mouse_y
0x00000000c012e148 _mouse_bytesRead
0x00000000c012e140 _mouse_x
0x00000000c012e14c _mouse_inbuffer
*fill* 0x00000000c012e15c 0x4 00
.bss 0x00000000c012e160 0x104 video.o
0x00000000c012e160 _video_mode
0x00000000c012e260 _videoMode
.bss 0x00000000c012e264 0x4 devfs.o
0x00000000c012e264 _dev
0x00000000c012f000 . = ALIGN (0x1000)
*fill* 0x00000000c012e268 0x8117e7800000d98 00
0x00000000c012f000 end = .
0x00000000c012f000 _end = .
0x00000000c012f000 __end = .
.bss 0x00000000c010e000 0x4 kernel.o
0x00000000c010e000 _timer
*fill* 0x00000000c010e004 0x4 00
*fill* 0x00000000c010e008 0x18 00
.bss 0x00000000c010e020 0x12b keyboard.o
0x00000000c010e040 _kbdBuffer
0x00000000c010e148 _kbdExt
0x00000000c010e021 _kbdAscii
0x00000000c010e149 _kbdExt2
0x00000000c010e14a _ackReason
0x00000000c010e140 _kbdBufferStart
0x00000000c010e022 _kbdScan
0x00000000c010e144 _kbdBufferLen
0x00000000c010e020 _kbdFlags
*fill* 0x00000000c010e14b 0x15 00
.bss 0x00000000c010e160 0xfc0 kio.o
0x00000000c010e180 _console_memory
0x00000000c010e160 _graphical
0x00000000c010e164 _cursorPosition
.bss 0x00000000c010f120 0x20020 mm.o
0x00000000c010f124 _mm_megabytes
0x00000000c010f140 _page_bitmap
0x00000000c010f120 _mm_totalmem
.bss 0x00000000c012f140 0x1c mouse.o
0x00000000c012f144 _mouse_y
0x00000000c012f148 _mouse_bytesRead
0x00000000c012f140 _mouse_x
0x00000000c012f14c _mouse_inbuffer
*fill* 0x00000000c012f15c 0x4 00
.bss 0x00000000c012f160 0x104 video.o
0x00000000c012f160 _video_mode
0x00000000c012f260 _videoMode
.bss 0x00000000c012f264 0x4 devfs.o
0x00000000c012f264 _dev
0x00000000c0130000 . = ALIGN (0x1000)
*fill* 0x00000000c012f268 0x80b9a5000000d98 00
0x00000000c0130000 end = .
0x00000000c0130000 _end = .
0x00000000c0130000 __end = .
LOAD ks.o
LOAD kernel.o
LOAD asmfuncs.o