diff options
author | rtm <rtm> | 2006-08-11 13:55:18 +0000 |
---|---|---|
committer | rtm <rtm> | 2006-08-11 13:55:18 +0000 |
commit | 17a856577f9db766b8ef7099d0575d378dff5dd1 (patch) | |
tree | 53d0c687d9c9bf83d097a2171c48d04a569c5a61 /fs.c | |
parent | 5be0039ce9e22f140a29e167526c64c723c5be3c (diff) | |
download | xv6-labs-17a856577f9db766b8ef7099d0575d378dff5dd1.tar.gz xv6-labs-17a856577f9db766b8ef7099d0575d378dff5dd1.tar.bz2 xv6-labs-17a856577f9db766b8ef7099d0575d378dff5dd1.zip |
init creates console, opens 0/1/2, runs sh
sh accepts 0-argument commands (like userfs)
reads from console
Diffstat (limited to 'fs.c')
-rw-r--r-- | fs.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -101,6 +101,7 @@ iget(uint dev, uint inum) goto loop; } ip->count++; + ip->busy = 1; release(&inode_table_lock); return ip; } @@ -269,16 +270,15 @@ bmap(struct inode *ip, uint bn) #define min(a, b) ((a) < (b) ? (a) : (b)) int -readi(struct inode *ip, void *xdst, uint off, uint n) +readi(struct inode *ip, char *dst, uint off, uint n) { - char *dst = (char *) xdst; uint target = n, n1; struct buf *bp; if (ip->type == T_DEV) { if (ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].d_read) return -1; - return devsw[ip->major].d_read (ip->minor, xdst, n); + return devsw[ip->major].d_read (ip->minor, dst, n); } while(n > 0 && off < ip->size){ @@ -298,7 +298,7 @@ readi(struct inode *ip, void *xdst, uint off, uint n) #define MIN(a, b) ((a < b) ? a : b) int -writei(struct inode *ip, void *addr, uint off, uint n) +writei(struct inode *ip, char *addr, uint off, uint n) { if (ip->type == T_DEV) { if (ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].d_write) @@ -404,7 +404,8 @@ mknod(struct inode *dp, char *cp, short type, short major, short minor) int i; struct buf *bp = 0; - cprintf("mknod: %s %d %d %d\n", cp, type, major, minor); + cprintf("mknod: dir %d %s %d %d %d\n", + dp->inum, cp, type, major, minor); ip = ialloc(dp->dev, type); if (ip == 0) return 0; |