Go to the documentation of this file.
42 static int devfs_len = 0x0;
53 K_PANIC(
"devfs: failed to allocate memor\n");
84 for (tmpDev = fsInfo->
deviceList; tmpDev != 0x0; tmpDev = tmpDev->
next) {
86 switch ((fd->
mode & 0x3)) {
112 static int devfs_read(
fileDescriptor_t *fd,
char *data,
long offset,
long size) {
113 int i = 0x0, x = 0x0;
120 kprintf(
"Hi Ubie [%i]!!!\n", size);
121 for (i = 0; i < size; i++) {
125 data[size - 1] =
'\n';
131 sectors = ((size + 511) / 512);
132 diff = (offset - ((offset / 512) * 512));
134 for (i = 0x0; i < sectors; i++) {
136 for (x = 0x0; x < (size - (i * 512)); x++) {
138 data[x] = fd->
buffer[x + diff];
158 static int devfs_write(
fileDescriptor_t *fd,
char *data,
long offset,
long size) {
159 int i = 0x0, x = 0x0;
164 for (i = 0x0; i < ((size + 511) / 512); i++) {
166 for (x = 0x0; ((x < 512) && ((x + (i * 512)) < size)); x++) {
185 kprintf(
"Error: Can't Find Mount Point\n");
216 (
void *) devfs_initialize,
218 (
void *) devfs_write,
232 vfs_mount(0x0, 0x0, 0x0, 0x1,
"devfs",
"rw");
int vfs_mount(int major, int minor, int partition, int vfsType, char *mountPoint, char *perms)
struct vfs_mountPoint * vfs_findMount(char *mountPoint)
unsigned short int uInt16
int strcmp(const char *str1, const char *str2)
void spinUnlock(spinLock_t *lock)
int strlen(const char *str)
#define SPIN_LOCK_INITIALIZER
struct devfs_devices * prev
struct vfs_mountPoint * mp
int sprintf(char *buf, const char *fmt,...)
void spinLock(spinLock_t *lock)
int vfsRegisterFS(struct fileSystem newFS)
register a file system
struct devfs_devices * deviceList
struct devfs_devices * next
int devfs_makeNode(char *name, uInt8 type, uInt16 major, uInt16 minor)
struct device_node * device_find(int major, int minor)
void * kmalloc(uInt32 len)
int kprintf(const char *,...)