// so we don't use spin locks. Instead, if a process wants to use
// a particular inode, it must sleep(ip) to wait for it to be not busy.
// See iget below.
-//
-// XXX Inodes with dev == 0 exist only in memory. They have no on-disk
-// representation. This functionality is used to implement pipes.
struct inode inode[NINODE];
struct spinlock inode_table_lock;
}
// Copy stat information from inode.
-// XXX Assumes inode is from disk file system.
void
stati(struct inode *ip, struct stat *st)
{
#define min(a, b) ((a) < (b) ? (a) : (b))
// Read data from inode.
-// XXX Assumes inode is from disk file system.
int
readi(struct inode *ip, char *dst, uint off, uint n)
{
}
// Write data to inode.
-// XXX Assumes inode is from disk file system.
int
writei(struct inode *ip, char *addr, uint off, uint n)
{
// File system super block
struct superblock {
- uint size; // Size of file system (bytes???) xxx
- uint nblocks; // Number of blocks
+ uint size; // Size of file system image (blocks)
+ uint nblocks; // Number of data blocks
uint ninodes; // Number of inodes.
};
}
c->gdt[0] = SEG_NULL;
- c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0x100000 + 64*1024, 0); // xxx
+ c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0x100000 + 64*1024, 0);
c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0);
c->gdt[SEG_TSS] = SEG16(STS_T32A, (uint) &c->ts, sizeof(c->ts), 0);
c->gdt[SEG_TSS].s = 0;