Compare commits
14 Commits
smp_might_
...
v3.1.3a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
957d948cbd | ||
|
|
b648da01d7 | ||
|
|
818b1a2741 | ||
|
|
2862654b07 | ||
|
|
26cf8b90ea | ||
|
|
1560fc9b94 | ||
|
|
af78f809ee | ||
|
|
0e44ca2b61 | ||
|
|
2db64a7fa5 | ||
|
|
3a3f4496d9 | ||
|
|
f73affcfc3 | ||
|
|
dc4916c77a | ||
|
|
0a9128303d | ||
|
|
ccd02a6028 |
@@ -63,9 +63,6 @@ int min_region_mb = 500;
|
||||
|
||||
#define MIN_REGION_SECTORS (1024*1024*min_region_mb/SECTOR_SIZE)
|
||||
|
||||
#define MAX_REGION_MB 4095
|
||||
#define MAX_REGION_SECTORS (1024*(1024/SECTOR_SIZE)*MAX_REGION_MB)
|
||||
|
||||
#define arraysize(a) (sizeof(a) / sizeof((a)[0]))
|
||||
#define arraylimit(a) ((a) + arraysize(a))
|
||||
|
||||
@@ -339,7 +336,7 @@ void newdevice(char *name, int scanning, int disk_only)
|
||||
if (curdev->rdev != DEV_C0D0) curdev= firstdev;
|
||||
}
|
||||
|
||||
void getdevices()
|
||||
void getdevices(void)
|
||||
/* Get all block devices from /dev that look interesting. */
|
||||
{
|
||||
DIR *d;
|
||||
@@ -2154,18 +2151,8 @@ scribble_region(region_t *reg, struct part_entry **pe, int *made_new)
|
||||
{
|
||||
int ex, changed = 0, i;
|
||||
struct part_entry *newpart;
|
||||
if(reg->is_used_part && reg->used_part.size > MAX_REGION_SECTORS) {
|
||||
reg->used_part.size = MAX_REGION_SECTORS;
|
||||
changed = 1;
|
||||
cylinderalign(reg);
|
||||
}
|
||||
if(!reg->is_used_part) {
|
||||
ex = reg->free_sec_last - reg->free_sec_start + 1;
|
||||
if(ex > MAX_REGION_SECTORS) {
|
||||
reg->free_sec_last -= ex - MAX_REGION_SECTORS;
|
||||
changed = 1;
|
||||
cylinderalign(reg);
|
||||
}
|
||||
if(made_new) *made_new = 1;
|
||||
} else if(made_new) *made_new = 0;
|
||||
if(!reg->is_used_part) {
|
||||
|
||||
@@ -246,7 +246,6 @@ do
|
||||
echo -n "
|
||||
MINIX needs one primary partition of $TOTALMB MB for a full install,
|
||||
plus what you want for /home.
|
||||
The maximum file system currently supported is 4 GB.
|
||||
|
||||
If there is no free space on your disk then you have to choose an option:
|
||||
(1) Delete one or more partitions
|
||||
|
||||
@@ -233,8 +233,7 @@ char *argv[];
|
||||
* reporting a 0-sized device (displays usage).
|
||||
*/
|
||||
if(blocks < 1) {
|
||||
fprintf(stderr, "%s: this device can't hold a filesystem.\n",
|
||||
progname);
|
||||
fprintf(stderr, "%s: zero size device.\n", progname);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -451,6 +450,7 @@ ino_t inodes;
|
||||
unsigned int i;
|
||||
int inodeblks;
|
||||
int initblks;
|
||||
zone_t zi, zz, zd;
|
||||
|
||||
zone_t initzones, nrzones, v1sq, v2sq;
|
||||
zone_t zo;
|
||||
@@ -469,14 +469,14 @@ ino_t inodes;
|
||||
sup->s_nzones = 0; /* not used in V2 - 0 forces errors early */
|
||||
sup->s_zones = zones;
|
||||
}
|
||||
sup->s_imap_blocks = bitmapsize((bit_t) (1 + inodes), block_size);
|
||||
sup->s_zmap_blocks = bitmapsize((bit_t) zones, block_size);
|
||||
sup->s_imap_blocks = zi = bitmapsize((bit_t) (1 + inodes), block_size);
|
||||
sup->s_zmap_blocks = zz = bitmapsize((bit_t) zones, block_size);
|
||||
inode_offset = sup->s_imap_blocks + sup->s_zmap_blocks + 2;
|
||||
inodeblks = (inodes + inodes_per_block - 1) / inodes_per_block;
|
||||
initblks = inode_offset + inodeblks;
|
||||
initzones = (initblks + (1 << zone_shift) - 1) >> zone_shift;
|
||||
nrzones = nrblocks >> zone_shift;
|
||||
sup->s_firstdatazone = (initblks + (1 << zone_shift) - 1) >> zone_shift;
|
||||
sup->s_firstdatazone = zd = (initblks + (1 << zone_shift) - 1) >> zone_shift;
|
||||
zoff = sup->s_firstdatazone - 1;
|
||||
sup->s_log_zone_size = zone_shift;
|
||||
if (fs_version == 1) {
|
||||
@@ -504,6 +504,16 @@ ino_t inodes;
|
||||
}
|
||||
}
|
||||
|
||||
/* checks for size */
|
||||
if(zi != sup->s_imap_blocks || sup->s_zmap_blocks != zz) {
|
||||
fprintf(stderr, "imap blocks or zmap blocks fields too small?\n");
|
||||
exit(1);
|
||||
}
|
||||
if(sup->s_firstdatazone != zd) {
|
||||
fprintf(stderr, "firstdatazone field too small?\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
zone_size = 1 << zone_shift; /* nr of blocks per zone */
|
||||
|
||||
if (lseek(fd, (off_t) _STATIC_BLOCK_SIZE, SEEK_SET) == (off_t) -1) {
|
||||
|
||||
@@ -124,8 +124,8 @@ char *argv[];
|
||||
/* Read the entire file. Try it in large chunks, but if an error
|
||||
* occurs, go to single reads for a while. */
|
||||
while (1) {
|
||||
if(lseek(fd, BLOCK_SIZE * b, SEEK_SET) < 0) {
|
||||
perror("lseek");
|
||||
if(lseek64(fd, mul64u(BLOCK_SIZE, b), SEEK_SET, NULL) < 0) {
|
||||
perror("lseek64");
|
||||
return 1;
|
||||
}
|
||||
s = read(fd, a, BLOCK_SIZE * chunk);
|
||||
|
||||
@@ -1026,7 +1026,7 @@ PRIVATE int w_identify()
|
||||
#endif
|
||||
}
|
||||
|
||||
if (wn->lcylinders == 0) {
|
||||
if (wn->lcylinders == 0 || wn->lheads == 0 || wn->lsectors == 0) {
|
||||
/* No BIOS parameters? Then make some up. */
|
||||
wn->lcylinders = wn->pcylinders;
|
||||
wn->lheads = wn->pheads;
|
||||
|
||||
@@ -37,10 +37,12 @@ PRIVATE struct pcitab
|
||||
};
|
||||
|
||||
_PROTOTYPE( static void rtl_init, (struct dpeth *dep) );
|
||||
#if 0
|
||||
_PROTOTYPE( static u16_t get_ee_word, (dpeth_t *dep, int a) );
|
||||
_PROTOTYPE( static void ee_wen, (dpeth_t *dep) );
|
||||
_PROTOTYPE( static void set_ee_word, (dpeth_t *dep, int a, U16_t w) );
|
||||
_PROTOTYPE( static void ee_wds, (dpeth_t *dep) );
|
||||
#endif
|
||||
_PROTOTYPE( static void micro_delay, (unsigned long usecs) );
|
||||
|
||||
PUBLIC int rtl_probe(dep)
|
||||
@@ -79,7 +81,7 @@ struct dpeth *dep;
|
||||
|
||||
for(;;)
|
||||
{
|
||||
for (i= 0; pcitab[i].vid != 0; i++)
|
||||
for (i= 0; pcitab[i].vid != 0 || pcitab[i].did != 0; i++)
|
||||
{
|
||||
if (pcitab[i].vid != vid)
|
||||
continue;
|
||||
@@ -93,7 +95,7 @@ struct dpeth *dep;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (pcitab[i].vid != 0)
|
||||
if (pcitab[i].vid != 0 || pcitab[i].did != 0)
|
||||
break;
|
||||
|
||||
if (just_one)
|
||||
@@ -116,7 +118,8 @@ struct dpeth *dep;
|
||||
dname= "unknown device";
|
||||
printf("%s: %s (%04X/%04X) at %s\n",
|
||||
dep->de_name, dname, vid, did, pci_slot_name(devind));
|
||||
pci_reserve(devind);
|
||||
if(pci_reserve_ok(devind) != OK)
|
||||
return 0;
|
||||
/* printf("cr = 0x%x\n", pci_attr_r16(devind, PCI_CR)); */
|
||||
bar= pci_attr_r32(devind, PCI_BAR) & 0xffffffe0;
|
||||
|
||||
@@ -199,6 +202,7 @@ dpeth_t *dep;
|
||||
printf("\n");
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
if (getenv("RTL8029MN"))
|
||||
{
|
||||
ee_wen(dep);
|
||||
@@ -226,8 +230,10 @@ dpeth_t *dep;
|
||||
|
||||
assert(get_ee_word(dep, 0x76/2) == 0x8029);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if 0
|
||||
static u16_t get_ee_word(dep, a)
|
||||
dpeth_t *dep;
|
||||
int a;
|
||||
@@ -365,6 +371,7 @@ dpeth_t *dep;
|
||||
outb_reg3(dep, 1, 0x00); /* back to normal */
|
||||
outb_reg0(dep, DP_CR, CR_PS_P0); /* back to bank 0 */
|
||||
}
|
||||
#endif
|
||||
|
||||
static void micro_delay(unsigned long usecs)
|
||||
{
|
||||
|
||||
@@ -148,7 +148,8 @@ int safe; /* safe copies */
|
||||
return EPERM;
|
||||
}
|
||||
|
||||
if (ex64hi(pos64) != 0)
|
||||
/* ZERO_DEV and NULL_DEV are infinite in size. */
|
||||
if (m_device != ZERO_DEV && m_device != NULL_DEV && ex64hi(pos64) != 0)
|
||||
return OK; /* Beyond EOF */
|
||||
position= cv64ul(pos64);
|
||||
|
||||
|
||||
@@ -140,10 +140,8 @@ message *mp;
|
||||
{
|
||||
/* Ignore all init calls for a process after the first one */
|
||||
}
|
||||
#if 0
|
||||
else
|
||||
pci_release(names[i].name);
|
||||
#endif
|
||||
names[i].tasknr= mp->m_source;
|
||||
|
||||
mp->m_type= 0;
|
||||
|
||||
@@ -387,7 +387,6 @@ char *name;
|
||||
return OK;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/*===========================================================================*
|
||||
* pci_release *
|
||||
*===========================================================================*/
|
||||
@@ -405,7 +404,6 @@ char *name;
|
||||
pcidev[i].pd_inuse= 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*===========================================================================*
|
||||
* pci_ids *
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
/usr/lib/em_opt 208000
|
||||
/usr/lib/i386/as 55000
|
||||
/usr/lib/i386/cg 50655
|
||||
/bin/sh 102400
|
||||
/usr/bin/make 337920
|
||||
/bin/sh 142400
|
||||
/usr/bin/make 380000
|
||||
|
||||
@@ -93,6 +93,7 @@ driver is
|
||||
GETINFO # 26
|
||||
SETGRANT # 34
|
||||
;
|
||||
uid 0;
|
||||
};
|
||||
|
||||
driver pci
|
||||
@@ -155,3 +156,27 @@ driver mfs
|
||||
;
|
||||
uid 0;
|
||||
};
|
||||
|
||||
driver printer
|
||||
{
|
||||
io 408:2 # LPT1
|
||||
40a:2 # LPT2
|
||||
40c:2 # LPT3
|
||||
40e:2 # LPT4
|
||||
;
|
||||
irq
|
||||
7 # PRINTER_IRQ
|
||||
;
|
||||
system
|
||||
KILL # 6
|
||||
SETGRANT # 34
|
||||
UMAP # 14
|
||||
VIRCOPY # 15
|
||||
IRQCTL # 19
|
||||
DEVIO # 21
|
||||
VDEVIO # 23
|
||||
SAFECOPYFROM # 31
|
||||
SAFECOPYTO # 32
|
||||
;
|
||||
};
|
||||
|
||||
|
||||
@@ -135,7 +135,8 @@ start)
|
||||
echo -n "Starting networking:"
|
||||
if grep -s 'psip0.*default' /etc/inet.conf
|
||||
then ifconfig -h 10.0.0.1
|
||||
else daemonize dhcpd
|
||||
else sleep 5
|
||||
daemonize dhcpd
|
||||
fi
|
||||
daemonize nonamed -L
|
||||
if [ -f "$DAEMONS" ]
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
/* Minix release and version numbers. */
|
||||
#define OS_RELEASE "3"
|
||||
#define OS_VERSION "1.3"
|
||||
#define OS_VERSION "1.3a"
|
||||
|
||||
/* This file sets configuration parameters for the MINIX kernel, FS, and PM.
|
||||
* It is divided up into two main sections. The first section contains
|
||||
|
||||
@@ -30,6 +30,7 @@ register message *m_ptr; /* pointer to request message */
|
||||
phys_bytes bytes; /* number of bytes to copy */
|
||||
int i;
|
||||
|
||||
#if 0
|
||||
if (m_ptr->m_source != 0 && m_ptr->m_source != 1 &&
|
||||
m_ptr->m_source != 2 && m_ptr->m_source != 3)
|
||||
{
|
||||
@@ -46,6 +47,7 @@ register message *m_ptr; /* pointer to request message */
|
||||
m_ptr->CP_DST_SPACE);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Dismember the command message. */
|
||||
vir_addr[_SRC_].proc_nr_e = m_ptr->CP_SRC_ENDPT;
|
||||
|
||||
@@ -20,7 +20,7 @@ PUBLIC struct mproc mproc[NR_PROCS];
|
||||
*===========================================================================*/
|
||||
PRIVATE char *flags_str(int flags)
|
||||
{
|
||||
static char str[10];
|
||||
static char str[13];
|
||||
str[0] = (flags & WAITING) ? 'W' : '-';
|
||||
str[1] = (flags & ZOMBIE) ? 'Z' : '-';
|
||||
str[2] = (flags & PAUSED) ? 'P' : '-';
|
||||
|
||||
@@ -350,12 +350,10 @@ PUBLIC int fs_rename()
|
||||
}
|
||||
next_new_superdirp = advance(&new_superdirp, dot2);
|
||||
put_inode(new_superdirp);
|
||||
/*
|
||||
if (next_new_superdirp == new_superdirp) {
|
||||
put_inode(new_superdirp);
|
||||
break;
|
||||
}
|
||||
*/
|
||||
if (err_code == ELEAVEMOUNT) {
|
||||
/* imitate that we are back at the root,
|
||||
* cross device checked already on VFS */
|
||||
|
||||
@@ -82,7 +82,7 @@ int flags; /* extra flags, if any */
|
||||
* arguments vector is: path, arguments, NULL.
|
||||
*/
|
||||
arg_count = 0; /* initialize arg count */
|
||||
rp->r_argv[arg_count++] = rp->r_cmd; /* start with path */
|
||||
rp->r_file = rp->r_argv[arg_count++] = rp->r_cmd; /* start with path */
|
||||
cmd_ptr = rp->r_cmd; /* do some parsing */
|
||||
while(*cmd_ptr != '\0') { /* stop at end of string */
|
||||
if (*cmd_ptr == ' ') { /* next argument */
|
||||
@@ -184,7 +184,7 @@ message *m_ptr; /* request message pointer */
|
||||
* arguments vector is: path, arguments, NULL.
|
||||
*/
|
||||
arg_count = 0; /* initialize arg count */
|
||||
rp->r_argv[arg_count++] = rp->r_cmd; /* start with path */
|
||||
rp->r_file = rp->r_argv[arg_count++] = rp->r_cmd; /* start with path */
|
||||
cmd_ptr = rp->r_cmd; /* do some parsing */
|
||||
while(*cmd_ptr != '\0') { /* stop at end of string */
|
||||
if (*cmd_ptr == ' ') { /* next argument */
|
||||
@@ -720,8 +720,9 @@ endpoint_t *endpoint;
|
||||
setuid(rp->r_uid);
|
||||
if (!use_copy)
|
||||
{
|
||||
execve(rp->r_argv[0], rp->r_argv, NULL); /* POSIX execute */
|
||||
file_only = strrchr(rp->r_argv[0], '/') + 1;
|
||||
rp->r_argv[0] = rp->r_label;
|
||||
execve(rp->r_file, rp->r_argv, NULL); /* POSIX execute */
|
||||
file_only = strrchr(rp->r_file, '/') + 1;
|
||||
execve(file_only, rp->r_argv, NULL); /* POSIX execute */
|
||||
}
|
||||
printf("RS: exec failed for %s: %d\n", rp->r_argv[0], errno);
|
||||
|
||||
@@ -42,6 +42,7 @@ extern struct rproc {
|
||||
char r_cmd[MAX_COMMAND_LEN]; /* raw command plus arguments */
|
||||
char r_script[MAX_SCRIPT_LEN]; /* name of the restart script executable */
|
||||
char *r_argv[MAX_NR_ARGS+2]; /* parsed arguments vector */
|
||||
char *r_file; /* path to binary to exec */
|
||||
int r_argc; /* number of arguments */
|
||||
|
||||
/* Resources */
|
||||
|
||||
@@ -86,7 +86,6 @@
|
||||
|
||||
#define DIR_ENTRY_SIZE usizeof (struct direct) /* # bytes/dir entry */
|
||||
#define NR_DIR_ENTRIES(b) ((b)/DIR_ENTRY_SIZE) /* # dir entries/blk */
|
||||
#define SUPER_SIZE usizeof (struct super_block) /* super_block size */
|
||||
#define PIPE_SIZE(b) (V1_NR_DZONES*(b)) /* pipe size in bytes */
|
||||
|
||||
#define FS_BITMAP_CHUNKS(b) ((b)/usizeof (bitchunk_t))/* # map chunks/blk */
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
FORWARD _PROTOTYPE( int safe_io_conversion, (endpoint_t,
|
||||
cp_grant_id_t *, int *, cp_grant_id_t *, int, endpoint_t *,
|
||||
void **, int *, vir_bytes, off_t *));
|
||||
void **, int *, vir_bytes, u32_t *));
|
||||
FORWARD _PROTOTYPE( void safe_io_cleanup, (cp_grant_id_t, cp_grant_id_t *,
|
||||
int));
|
||||
|
||||
@@ -170,7 +170,7 @@ PUBLIC void dev_status(message *m)
|
||||
* safe_io_conversion *
|
||||
*===========================================================================*/
|
||||
PRIVATE int safe_io_conversion(driver, gid, op, gids, gids_size,
|
||||
io_ept, buf, vec_grants, bytes, pos)
|
||||
io_ept, buf, vec_grants, bytes, pos_lo)
|
||||
endpoint_t driver;
|
||||
cp_grant_id_t *gid;
|
||||
int *op;
|
||||
@@ -180,7 +180,7 @@ endpoint_t *io_ept;
|
||||
void **buf;
|
||||
int *vec_grants;
|
||||
vir_bytes bytes;
|
||||
off_t *pos;
|
||||
u32_t *pos_lo;
|
||||
{
|
||||
int access = 0, size;
|
||||
int j;
|
||||
@@ -242,7 +242,7 @@ off_t *pos;
|
||||
*buf = new_iovec;
|
||||
break;
|
||||
case VFS_DEV_IOCTL:
|
||||
*pos = *io_ept; /* Old endpoint in POSITION field. */
|
||||
*pos_lo = *io_ept; /* Old endpoint in POSITION field. */
|
||||
*op = DEV_IOCTL_S;
|
||||
if(_MINIX_IOCTL_IOR(m_in.REQUEST)) access |= CPF_WRITE;
|
||||
if(_MINIX_IOCTL_IOW(m_in.REQUEST)) access |= CPF_READ;
|
||||
@@ -303,6 +303,7 @@ int gids_size;
|
||||
return;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/*===========================================================================*
|
||||
* dev_bio *
|
||||
*===========================================================================*/
|
||||
@@ -420,22 +421,23 @@ int bytes; /* how many bytes to transfer */
|
||||
return(m.REP_STATUS);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*===========================================================================*
|
||||
* dev_io *
|
||||
*===========================================================================*/
|
||||
PUBLIC int dev_io(op, dev, proc_e, buf, posX, bytes, flags)
|
||||
PUBLIC int dev_io(op, dev, proc_e, buf, pos, bytes, flags)
|
||||
int op; /* DEV_READ, DEV_WRITE, DEV_IOCTL, etc. */
|
||||
dev_t dev; /* major-minor device number */
|
||||
int proc_e; /* in whose address space is buf? */
|
||||
void *buf; /* virtual address of the buffer */
|
||||
u64_t posX; /* byte position */
|
||||
u64_t pos; /* byte position */
|
||||
int bytes; /* how many bytes to transfer */
|
||||
int flags; /* special flags, like O_NONBLOCK */
|
||||
{
|
||||
/* Read or write from a device. The parameter 'dev' tells which one. */
|
||||
struct dmap *dp;
|
||||
off_t pos;
|
||||
u32_t pos_lo, pos_high;
|
||||
message dev_mess;
|
||||
cp_grant_id_t gid = GRANT_INVALID;
|
||||
static cp_grant_id_t gids[NR_IOREQS];
|
||||
@@ -443,9 +445,8 @@ int flags; /* special flags, like O_NONBLOCK */
|
||||
void *buf_used;
|
||||
endpoint_t ioproc;
|
||||
|
||||
if (ex64hi(posX) != 0)
|
||||
panic(__FILE__, "dev_io: postition too high", NO_NUM);
|
||||
pos= ex64lo(posX);
|
||||
pos_lo= ex64lo(pos);
|
||||
pos_high= ex64hi(pos);
|
||||
|
||||
/* Determine task dmap. */
|
||||
dp = &dmap[(dev >> MAJOR) & BYTE];
|
||||
@@ -471,7 +472,7 @@ int flags; /* special flags, like O_NONBLOCK */
|
||||
buf_used = buf;
|
||||
safe = safe_io_conversion(dp->dmap_driver, &gid,
|
||||
&op, gids, NR_IOREQS, &dev_mess.IO_ENDPT, &buf_used,
|
||||
&vec_grants, bytes, &pos);
|
||||
&vec_grants, bytes, &pos_lo);
|
||||
|
||||
if(buf != buf_used)
|
||||
panic(__FILE__,"dev_io: safe_io_conversion changed buffer", NO_NUM);
|
||||
@@ -484,9 +485,9 @@ int flags; /* special flags, like O_NONBLOCK */
|
||||
/* Set up the rest of the message passed to task. */
|
||||
dev_mess.m_type = op;
|
||||
dev_mess.DEVICE = (dev >> MINOR) & BYTE;
|
||||
dev_mess.POSITION = pos;
|
||||
dev_mess.POSITION = pos_lo;
|
||||
dev_mess.COUNT = bytes;
|
||||
dev_mess.HIGHPOS = 0;
|
||||
dev_mess.HIGHPOS = pos_high;
|
||||
|
||||
/* This will be used if the i/o is suspended. */
|
||||
ioproc = dev_mess.IO_ENDPT;
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
/* Inode table. This table holds inodes that are currently in use. In some
|
||||
* cases they have been opened by an open() or creat() system call, in other
|
||||
* cases the file system itself needs the inode for one reason or another,
|
||||
* such as to search a directory for a path name.
|
||||
* The first part of the struct holds fields that are present on the
|
||||
* disk; the second part holds fields not present on the disk.
|
||||
* The disk inode part is also declared in "type.h" as 'd1_inode' for V1
|
||||
* file systems and 'd2_inode' for V2 file systems.
|
||||
*/
|
||||
|
||||
EXTERN struct inode {
|
||||
mode_t i_mode; /* file type, protection, etc. */
|
||||
nlink_t i_nlinks; /* how many links to this file */
|
||||
uid_t i_uid; /* user id of the file's owner */
|
||||
gid_t i_gid; /* group number */
|
||||
off_t i_size; /* current file size in bytes */
|
||||
time_t i_atime; /* time of last access (V2 only) */
|
||||
time_t i_mtime; /* when was file data last changed */
|
||||
time_t i_ctime; /* when was inode itself changed (V2 only)*/
|
||||
zone_t i_zone[V2_NR_TZONES]; /* zone numbers for direct, ind, and dbl ind */
|
||||
|
||||
/* The following items are not present on the disk. */
|
||||
dev_t i_dev; /* which device is the inode on */
|
||||
ino_t i_num; /* inode number on its (minor) device */
|
||||
int i_count; /* # times inode used; 0 means slot is free */
|
||||
int i_ndzones; /* # direct zones (Vx_NR_DZONES) */
|
||||
int i_nindirs; /* # indirect zones per indirect block */
|
||||
struct super_block *i_sp; /* pointer to super block for inode's device */
|
||||
char i_dirt; /* CLEAN or DIRTY */
|
||||
char i_pipe; /* set to I_PIPE if pipe */
|
||||
char i_mount; /* this bit is set if file mounted on */
|
||||
char i_seek; /* set on LSEEK, cleared on READ/WRITE */
|
||||
char i_update; /* the ATIME, CTIME, and MTIME bits are here */
|
||||
} inode[NR_INODES];
|
||||
|
||||
#define NIL_INODE (struct inode *) 0 /* indicates absence of inode slot */
|
||||
|
||||
/* Field values. Note that CLEAN and DIRTY are defined in "const.h" */
|
||||
#define NO_PIPE 0 /* i_pipe is NO_PIPE if inode is not a pipe */
|
||||
#define I_PIPE 1 /* i_pipe is I_PIPE if inode is a pipe */
|
||||
#define NO_MOUNT 0 /* i_mount is NO_MOUNT if file not mounted on*/
|
||||
#define I_MOUNT 1 /* i_mount is I_MOUNT if file mounted on */
|
||||
#define NO_SEEK 0 /* i_seek = NO_SEEK if last op was not SEEK */
|
||||
#define ISEEK 1 /* i_seek = ISEEK if last op was SEEK */
|
||||
@@ -319,8 +319,10 @@ PRIVATE void init_root()
|
||||
last_login_fs_e = NONE;
|
||||
|
||||
/* Initialize vmnt table */
|
||||
for (vmp = &vmnt[0]; vmp < &vmnt[NR_MNTS]; ++vmp)
|
||||
for (vmp = &vmnt[0]; vmp < &vmnt[NR_MNTS]; ++vmp) {
|
||||
vmp->m_dev = NO_DEV;
|
||||
vmp->m_fs_e = NONE;
|
||||
}
|
||||
|
||||
vmp = &vmnt[0];
|
||||
|
||||
@@ -411,7 +413,7 @@ PRIVATE void service_pm()
|
||||
|
||||
/* Send new time for all FS processes */
|
||||
for (vmp = &vmnt[0]; vmp < &vmnt[NR_MNTS]; ++vmp) {
|
||||
if (vmp->m_fs_e)
|
||||
if (vmp->m_fs_e != NONE)
|
||||
req_stime(vmp->m_fs_e, boottime);
|
||||
}
|
||||
/* No need to report status to PM */
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
/* Super block table. The root file system and every mounted file system
|
||||
* has an entry here. The entry holds information about the sizes of the bit
|
||||
* maps and inodes. The s_ninodes field gives the number of inodes available
|
||||
* for files and directories, including the root directory. Inode 0 is
|
||||
* on the disk, but not used. Thus s_ninodes = 4 means that 5 bits will be
|
||||
* used in the bit map, bit 0, which is always 1 and not used, and bits 1-4
|
||||
* for files and directories. The disk layout is:
|
||||
*
|
||||
* Item # blocks
|
||||
* boot block 1
|
||||
* super block 1 (offset 1kB)
|
||||
* inode map s_imap_blocks
|
||||
* zone map s_zmap_blocks
|
||||
* inodes (s_ninodes + 'inodes per block' - 1)/'inodes per block'
|
||||
* unused whatever is needed to fill out the current zone
|
||||
* data zones (s_zones - s_firstdatazone) << s_log_zone_size
|
||||
*
|
||||
* A super_block slot is free if s_dev == NO_DEV.
|
||||
*/
|
||||
|
||||
EXTERN struct super_block {
|
||||
ino_t s_ninodes; /* # usable inodes on the minor device */
|
||||
zone1_t s_nzones; /* total device size, including bit maps etc */
|
||||
short s_imap_blocks; /* # of blocks used by inode bit map */
|
||||
short s_zmap_blocks; /* # of blocks used by zone bit map */
|
||||
zone1_t s_firstdatazone; /* number of first data zone */
|
||||
short s_log_zone_size; /* log2 of blocks/zone */
|
||||
short s_pad; /* try to avoid compiler-dependent padding */
|
||||
off_t s_max_size; /* maximum file size on this device */
|
||||
zone_t s_zones; /* number of zones (replaces s_nzones in V2) */
|
||||
short s_magic; /* magic number to recognize super-blocks */
|
||||
|
||||
/* The following items are valid on disk only for V3 and above */
|
||||
|
||||
/* The block size in bytes. Minimum MIN_BLOCK SIZE. SECTOR_SIZE
|
||||
* multiple. If V1 or V2 filesystem, this should be
|
||||
* initialised to STATIC_BLOCK_SIZE. Maximum MAX_BLOCK_SIZE.
|
||||
*/
|
||||
short s_pad2; /* try to avoid compiler-dependent padding */
|
||||
unsigned short s_block_size; /* block size in bytes. */
|
||||
char s_disk_version; /* filesystem format sub-version */
|
||||
|
||||
/* The following items are only used when the super_block is in memory. */
|
||||
struct inode *s_isup; /* inode for root dir of mounted file sys */
|
||||
struct inode *s_imount; /* inode mounted on */
|
||||
unsigned s_inodes_per_block; /* precalculated from magic number */
|
||||
dev_t s_dev; /* whose super block is this? */
|
||||
int s_rd_only; /* set to 1 iff file sys mounted read only */
|
||||
int s_native; /* set to 1 iff not byte swapped file system */
|
||||
int s_version; /* file system version, zero means bad magic */
|
||||
int s_ndzones; /* # direct zones in an inode */
|
||||
int s_nindirs; /* # indirect zones per indirect block */
|
||||
bit_t s_isearch; /* inodes below this bit number are in use */
|
||||
bit_t s_zsearch; /* all zones below this bit number are in use*/
|
||||
} super_block[NR_SUPERS];
|
||||
|
||||
#define NIL_SUPER (struct super_block *) 0
|
||||
#define IMAP 0 /* operating on the inode bit map */
|
||||
#define ZMAP 1 /* operating on the zone bit map */
|
||||
@@ -72,7 +72,7 @@ PUBLIC int do_stime()
|
||||
|
||||
/* Send new time for all FS processes */
|
||||
for (vmp = &vmnt[0]; vmp < &vmnt[NR_MNTS]; ++vmp) {
|
||||
if (vmp->m_fs_e) req_stime(vmp->m_fs_e, boottime);
|
||||
if (vmp->m_fs_e != NONE) req_stime(vmp->m_fs_e, boottime);
|
||||
}
|
||||
|
||||
return OK;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
* Jul 2006 (Balazs Gerofi)
|
||||
*/
|
||||
|
||||
#include <minix/com.h>
|
||||
|
||||
#include "fs.h"
|
||||
#include "vmnt.h"
|
||||
|
||||
@@ -27,6 +29,8 @@ PUBLIC struct vmnt *get_free_vmnt(short *index)
|
||||
PUBLIC struct vmnt *find_vmnt(int fs_e)
|
||||
{
|
||||
struct vmnt *vp;
|
||||
if(fs_e == NONE)
|
||||
panic(__FILE__, "find_vmnt: find for NONE", NO_NUM);
|
||||
for (vp = &vmnt[0]; vp < &vmnt[NR_MNTS]; ++vp) {
|
||||
if (vp->m_fs_e == fs_e) return vp;
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ void test23a()
|
||||
if (chdir(".//.//") != 0) e(39); /* .//.// == current dir */
|
||||
if (getcwd(buf, PATH_MAX) != buf) e(40);
|
||||
if (strcmp(buf, cwd) != 0) e(41); /* we might be at '/' */
|
||||
#ifdef _MINIX
|
||||
#if 0
|
||||
/* XXX - my_getcwd() is old rubbish. It reads the directory directly instead
|
||||
* of through the directory library. It uses a fixed size buffer instead of
|
||||
* a size related to PATH_MAX, NAME_MAX or the size required.
|
||||
|
||||
@@ -95,11 +95,13 @@ SVNREV=""
|
||||
REVTAG=""
|
||||
PACKAGES=1
|
||||
|
||||
while getopts "pchu?r:" c
|
||||
FILENAMEOUT=""
|
||||
|
||||
while getopts "s:pchu?r:f:" c
|
||||
do
|
||||
case "$c" in
|
||||
\?)
|
||||
echo "Usage: $0 [-p] [-c] [-h] [-r <tag>] [-u]" >&2
|
||||
echo "Usage: $0 [-p] [-c] [-h] [-r <tag>] [-u] [-f <filename>] [-s <username>]" >&2
|
||||
exit 1
|
||||
;;
|
||||
h)
|
||||
@@ -123,6 +125,11 @@ do
|
||||
HDEMU=1
|
||||
USB=1
|
||||
;;
|
||||
f)
|
||||
FILENAMEOUT="$OPTARG"
|
||||
;;
|
||||
s) USERNAME="--username=$OPTARG"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -214,7 +221,7 @@ then
|
||||
fi
|
||||
|
||||
echo " * Cleanup old files"
|
||||
rm -rf $RELEASEDIR $IMG $IMAGE $ROOTIMAGE $IMGBZ $CDFILES image*
|
||||
rm -rf $RELEASEDIR $IMG $IMAGE $ROOTIMAGE $CDFILES image*
|
||||
mkdir -p $CDFILES || exit
|
||||
mkdir -p $RELEASEDIR
|
||||
mkfs -B $BS -b $ROOTBLOCKS $TMPDISK3 || exit
|
||||
@@ -280,9 +287,9 @@ if [ "$COPY" -ne 1 ]
|
||||
then
|
||||
echo " * Doing new svn export"
|
||||
REPO=https://gforge.cs.vu.nl/svn/minix/trunk/$SRC
|
||||
REVISION="`svn info $SVNREV $REPO | grep '^Revision: ' | awk '{ print $2 }'`"
|
||||
REVISION="`svn info $USERNAME $SVNREV $REPO | grep '^Revision: ' | awk '{ print $2 }'`"
|
||||
echo "Doing export of revision $REVISION from $REPO."
|
||||
( cd $RELEASEDIR/usr && svn export -r$REVISION $REPO )
|
||||
( cd $RELEASEDIR/usr && svn $USERNAME export -r$REVISION $REPO )
|
||||
REVTAG=r$REVISION
|
||||
echo "
|
||||
|
||||
@@ -303,8 +310,6 @@ if [ "$USB" -ne 0 ]; then
|
||||
else
|
||||
IMG=${IMG_BASE}_${REVTAG}.iso
|
||||
fi
|
||||
IMGBZ=${IMG}.bz2
|
||||
echo "Making $IMGBZ"
|
||||
|
||||
echo " * Fixups for owners and modes of dirs and files"
|
||||
chown -R bin $RELEASEDIR/usr/$SRC
|
||||
@@ -337,7 +342,7 @@ then
|
||||
hdemu_root_changes
|
||||
fi
|
||||
|
||||
echo $version_pretty >$RELEASEDIR/etc/version
|
||||
echo $version_pretty, SVN revision $SVNREV, generated `date` >$RELEASEDIR/etc/version
|
||||
echo " * Counting files"
|
||||
extrakb=`du -s $RELEASEDIR/usr/install | awk '{ print $1 }'`
|
||||
expr `df $TMPDISK | tail -1 | awk '{ print $4 }'` - $extrakb >$RELEASEDIR/.usrkb
|
||||
@@ -403,3 +408,7 @@ else
|
||||
partition -m $IMG 0 81:$isosects 81:$ROOTSECTS 81:$USRSECTS
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$FILENAMEOUT" ]
|
||||
then echo "$IMG" >$FILENAMEOUT
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user