Compare commits

...

20 Commits

Author SHA1 Message Date
Ben Gras
37ce5d759b build fix for gcc
M    flex-2.5.4/build
2008-07-26 18:52:40 +00:00
Ben Gras
0b413acf95 lance not necessary 2008-07-25 15:21:03 +00:00
Ben Gras
95aa8cf5a5 Solution/workaround for lance driver under vmware 2008-07-25 15:08:40 +00:00
Ben Gras
cbe9454704 Minor tweaks to menu naming. 2007-11-07 09:28:44 +00:00
Ben Gras
e104c634ad Call it minix, not regular minix 2007-11-06 17:02:23 +00:00
Ben Gras
53dce25cfd Small image not built currently. 2007-11-06 17:02:05 +00:00
Ben Gras
741f3678e9 hack to avoid firstdatazone overflow problem when no. of
inodes gets too large. real solution (computing firstdatazone
instead of storing it in the superblock) to follow on trunk.
2007-11-06 16:55:48 +00:00
Ben Gras
6ec8998639 backport some fixes from the trunk to the 3.1.3 branch, to be 3.1.3b.
most notably unbreaks floppy driver.
2007-11-06 14:06:10 +00:00
Ben Gras
818b1a2741 Disable this test - there's a bug that vfs doesn't know an
updated directory size after new directory entries are added. To
be fixed.
2007-06-07 09:59:44 +00:00
Ben Gras
2862654b07 firstdatazone is prone to overflowing with many inodes. 2007-06-06 15:14:58 +00:00
Ben Gras
26cf8b90ea Not used in vfs. 2007-06-06 14:48:18 +00:00
Ben Gras
1560fc9b94 Bugfix for 'mkdir x; mkdir y; mv x y' 2007-05-31 13:37:38 +00:00
Ben Gras
af78f809ee improve FS process bookkeeping; fixes bug where vfs tries to e.g. send
stime messages to NONE of an unmounted filesystem.
2007-05-31 12:20:09 +00:00
Ben Gras
0e44ca2b61 Hack for dhcp on 3.1.3 branch (not necessary on trunk) 2007-05-30 16:44:43 +00:00
Ben Gras
2db64a7fa5 run is as root so it can retrieve its signal set 2007-05-30 16:41:14 +00:00
Ben Gras
3a3f4496d9 Assume bios parameters are wrong/missing if any of the parameters are 0. 2007-05-30 16:13:36 +00:00
Ben Gras
f73affcfc3 Disable copy diagnostic. 2007-05-30 15:45:47 +00:00
Ben Gras
dc4916c77a include 'printer' 2007-05-30 15:39:27 +00:00
Ben Gras
0a9128303d New small release of 3.1.3 branch in preparation. 2007-05-30 13:40:54 +00:00
Ben Gras
ccd02a6028 Backports and a fix for the 3.1.3 branch.
. backports of various fixes already on the trunk
  . pass label of driver as argv[0], allowing the pci
    driver to free pci resources for it (solved differently
    on the trunk code), allowing pci drivers to be restarted
2007-05-01 13:29:50 +00:00
38 changed files with 217 additions and 230 deletions

View File

@ -16,7 +16,7 @@ $INSTALL FlexLexer.h /usr/local/include
$INSTALL libfl.a /usr/lib/i386 $INSTALL libfl.a /usr/lib/i386
if [ -f /usr/gnu/bin/gcc ] if [ -f /usr/gnu/bin/gcc ]
then PATH=/usr/gnu/bin:$PATH then export PATH=/usr/gnu/bin:$PATH
rm -f $CCACHE rm -f $CCACHE
YACC=/usr/bin/yacc CC=gcc CONFIG_SHELL=/bin/bigsh AR=gar /bin/bigsh ./configure YACC=/usr/bin/yacc CC=gcc CONFIG_SHELL=/bin/bigsh AR=gar /bin/bigsh ./configure
make clean $L make clean $L

View File

@ -63,9 +63,6 @@ int min_region_mb = 500;
#define MIN_REGION_SECTORS (1024*1024*min_region_mb/SECTOR_SIZE) #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 arraysize(a) (sizeof(a) / sizeof((a)[0]))
#define arraylimit(a) ((a) + arraysize(a)) #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; if (curdev->rdev != DEV_C0D0) curdev= firstdev;
} }
void getdevices() void getdevices(void)
/* Get all block devices from /dev that look interesting. */ /* Get all block devices from /dev that look interesting. */
{ {
DIR *d; DIR *d;
@ -2154,18 +2151,8 @@ scribble_region(region_t *reg, struct part_entry **pe, int *made_new)
{ {
int ex, changed = 0, i; int ex, changed = 0, i;
struct part_entry *newpart; 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) { if(!reg->is_used_part) {
ex = reg->free_sec_last - reg->free_sec_start + 1; 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; if(made_new) *made_new = 1;
} else if(made_new) *made_new = 0; } else if(made_new) *made_new = 0;
if(!reg->is_used_part) { if(!reg->is_used_part) {

View File

@ -128,6 +128,6 @@ char **argv;
sync(); sync();
reboot(flag, monitor_code, strlen(monitor_code)); reboot(flag, monitor_code, strlen(monitor_code));
fprintf(stderr, "%s: reboot(): %s\n", strerror(errno)); fprintf(stderr, "%s: reboot(): %s\n", prog, strerror(errno));
return 1; return 1;
} }

View File

@ -246,7 +246,6 @@ do
echo -n " echo -n "
MINIX needs one primary partition of $TOTALMB MB for a full install, MINIX needs one primary partition of $TOTALMB MB for a full install,
plus what you want for /home. 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: If there is no free space on your disk then you have to choose an option:
(1) Delete one or more partitions (1) Delete one or more partitions
@ -585,7 +584,7 @@ mount /dev/$usr /mnt >/dev/null || exit
# Make bootable. # Make bootable.
installboot -d /dev/$root /usr/mdec/bootblock /boot/boot >/dev/null || exit installboot -d /dev/$root /usr/mdec/bootblock /boot/boot >/dev/null || exit
edparams /dev/$root "rootdev=$root; ramimagedev=$root; minix(1,Start MINIX 3) { image=/boot/image_big; boot; }; smallminix(2,Start Small MINIX 3 (uses less memory)) { image=/boot/image_small; boot; }; newminix(3,Start Custom MINIX 3) { unset image; boot }; main() { echo By default, MINIX 3 will automatically load in 3 seconds.; echo Press ESC to enter the monitor for special configuration.; trap 3000 boot; menu; }; save" || exit edparams /dev/$root "rootdev=$root; ramimagedev=$root; minix(1,Start MINIX 3) { image=/boot/image_big; boot; }; newminix(2,Start Custom MINIX 3) { unset image; boot }; main() { echo By default, MINIX 3 will automatically load in 3 seconds.; echo Press ESC to enter the monitor for special configuration.; trap 3000 boot; menu; }; save" || exit
pfile="/mnt/src/tools/fdbootparams" pfile="/mnt/src/tools/fdbootparams"
echo "rootdev=$root; ramimagedev=$root; save" >$pfile echo "rootdev=$root; ramimagedev=$root; save" >$pfile
# Save name of CD drive # Save name of CD drive

View File

@ -33,6 +33,8 @@
#include <tools.h> #include <tools.h>
#include <dirent.h> #include <dirent.h>
#define MAX_INODES (2*1024*1024)
#undef EXTERN #undef EXTERN
#define EXTERN /* get rid of EXTERN by making it null */ #define EXTERN /* get rid of EXTERN by making it null */
#include "../../servers/mfs/super.h" #include "../../servers/mfs/super.h"
@ -233,8 +235,7 @@ char *argv[];
* reporting a 0-sized device (displays usage). * reporting a 0-sized device (displays usage).
*/ */
if(blocks < 1) { if(blocks < 1) {
fprintf(stderr, "%s: this device can't hold a filesystem.\n", fprintf(stderr, "%s: zero size device.\n", progname);
progname);
return 1; return 1;
} }
} }
@ -318,6 +319,11 @@ char *argv[];
simple = 1; simple = 1;
} }
if(inodes > MAX_INODES) {
inodes = MAX_INODES;
fprintf(stderr, "capping no. of inodes to %lu.\n", inodes);
}
nrblocks = blocks; nrblocks = blocks;
nrinodes = inodes; nrinodes = inodes;
@ -451,6 +457,7 @@ ino_t inodes;
unsigned int i; unsigned int i;
int inodeblks; int inodeblks;
int initblks; int initblks;
zone_t zi, zz, zd;
zone_t initzones, nrzones, v1sq, v2sq; zone_t initzones, nrzones, v1sq, v2sq;
zone_t zo; zone_t zo;
@ -469,14 +476,14 @@ ino_t inodes;
sup->s_nzones = 0; /* not used in V2 - 0 forces errors early */ sup->s_nzones = 0; /* not used in V2 - 0 forces errors early */
sup->s_zones = zones; sup->s_zones = zones;
} }
sup->s_imap_blocks = bitmapsize((bit_t) (1 + inodes), block_size); sup->s_imap_blocks = zi = bitmapsize((bit_t) (1 + inodes), block_size);
sup->s_zmap_blocks = bitmapsize((bit_t) zones, block_size); sup->s_zmap_blocks = zz = bitmapsize((bit_t) zones, block_size);
inode_offset = sup->s_imap_blocks + sup->s_zmap_blocks + 2; inode_offset = sup->s_imap_blocks + sup->s_zmap_blocks + 2;
inodeblks = (inodes + inodes_per_block - 1) / inodes_per_block; inodeblks = (inodes + inodes_per_block - 1) / inodes_per_block;
initblks = inode_offset + inodeblks; initblks = inode_offset + inodeblks;
initzones = (initblks + (1 << zone_shift) - 1) >> zone_shift; initzones = (initblks + (1 << zone_shift) - 1) >> zone_shift;
nrzones = nrblocks >> 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; zoff = sup->s_firstdatazone - 1;
sup->s_log_zone_size = zone_shift; sup->s_log_zone_size = zone_shift;
if (fs_version == 1) { if (fs_version == 1) {
@ -504,6 +511,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 */ zone_size = 1 << zone_shift; /* nr of blocks per zone */
if (lseek(fd, (off_t) _STATIC_BLOCK_SIZE, SEEK_SET) == (off_t) -1) { if (lseek(fd, (off_t) _STATIC_BLOCK_SIZE, SEEK_SET) == (off_t) -1) {

View File

@ -124,8 +124,8 @@ char *argv[];
/* Read the entire file. Try it in large chunks, but if an error /* Read the entire file. Try it in large chunks, but if an error
* occurs, go to single reads for a while. */ * occurs, go to single reads for a while. */
while (1) { while (1) {
if(lseek(fd, BLOCK_SIZE * b, SEEK_SET) < 0) { if(lseek64(fd, mul64u(BLOCK_SIZE, b), SEEK_SET, NULL) < 0) {
perror("lseek"); perror("lseek64");
return 1; return 1;
} }
s = read(fd, a, BLOCK_SIZE * chunk); s = read(fd, a, BLOCK_SIZE * chunk);

View File

@ -1026,7 +1026,7 @@ PRIVATE int w_identify()
#endif #endif
} }
if (wn->lcylinders == 0) { if (wn->lcylinders == 0 || wn->lheads == 0 || wn->lsectors == 0) {
/* No BIOS parameters? Then make some up. */ /* No BIOS parameters? Then make some up. */
wn->lcylinders = wn->pcylinders; wn->lcylinders = wn->pcylinders;
wn->lheads = wn->pheads; wn->lheads = wn->pheads;

View File

@ -37,10 +37,12 @@ PRIVATE struct pcitab
}; };
_PROTOTYPE( static void rtl_init, (struct dpeth *dep) ); _PROTOTYPE( static void rtl_init, (struct dpeth *dep) );
#if 0
_PROTOTYPE( static u16_t get_ee_word, (dpeth_t *dep, int a) ); _PROTOTYPE( static u16_t get_ee_word, (dpeth_t *dep, int a) );
_PROTOTYPE( static void ee_wen, (dpeth_t *dep) ); _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 set_ee_word, (dpeth_t *dep, int a, U16_t w) );
_PROTOTYPE( static void ee_wds, (dpeth_t *dep) ); _PROTOTYPE( static void ee_wds, (dpeth_t *dep) );
#endif
_PROTOTYPE( static void micro_delay, (unsigned long usecs) ); _PROTOTYPE( static void micro_delay, (unsigned long usecs) );
PUBLIC int rtl_probe(dep) PUBLIC int rtl_probe(dep)
@ -79,7 +81,7 @@ struct dpeth *dep;
for(;;) 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) if (pcitab[i].vid != vid)
continue; continue;
@ -93,7 +95,7 @@ struct dpeth *dep;
} }
break; break;
} }
if (pcitab[i].vid != 0) if (pcitab[i].vid != 0 || pcitab[i].did != 0)
break; break;
if (just_one) if (just_one)
@ -116,7 +118,8 @@ struct dpeth *dep;
dname= "unknown device"; dname= "unknown device";
printf("%s: %s (%04X/%04X) at %s\n", printf("%s: %s (%04X/%04X) at %s\n",
dep->de_name, dname, vid, did, pci_slot_name(devind)); 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)); */ /* printf("cr = 0x%x\n", pci_attr_r16(devind, PCI_CR)); */
bar= pci_attr_r32(devind, PCI_BAR) & 0xffffffe0; bar= pci_attr_r32(devind, PCI_BAR) & 0xffffffe0;
@ -199,6 +202,7 @@ dpeth_t *dep;
printf("\n"); printf("\n");
#endif #endif
#if 0
if (getenv("RTL8029MN")) if (getenv("RTL8029MN"))
{ {
ee_wen(dep); ee_wen(dep);
@ -226,8 +230,10 @@ dpeth_t *dep;
assert(get_ee_word(dep, 0x76/2) == 0x8029); assert(get_ee_word(dep, 0x76/2) == 0x8029);
} }
#endif
} }
#if 0
static u16_t get_ee_word(dep, a) static u16_t get_ee_word(dep, a)
dpeth_t *dep; dpeth_t *dep;
int a; int a;
@ -365,6 +371,7 @@ dpeth_t *dep;
outb_reg3(dep, 1, 0x00); /* back to normal */ outb_reg3(dep, 1, 0x00); /* back to normal */
outb_reg0(dep, DP_CR, CR_PS_P0); /* back to bank 0 */ outb_reg0(dep, DP_CR, CR_PS_P0); /* back to bank 0 */
} }
#endif
static void micro_delay(unsigned long usecs) static void micro_delay(unsigned long usecs)
{ {

View File

@ -130,10 +130,10 @@ static void el3_write_fifo(dpeth_t * dep, int pktsize)
bytes = iovp->iod_iovec[ix].iov_size; /* Size of buffer */ bytes = iovp->iod_iovec[ix].iov_size; /* Size of buffer */
if (bytes > pktsize) bytes = pktsize; if (bytes > pktsize) bytes = pktsize;
/* Writes from user buffer to Tx FIFO */ /* Writes from user buffer to Tx FIFO */
r= sys_safe_insb(dep->de_data_port, iovp->iod_proc_nr, r= sys_safe_outsb(dep->de_data_port, iovp->iod_proc_nr,
iovp->iod_iovec[ix].iov_grant, 0, bytes); iovp->iod_iovec[ix].iov_grant, 0, bytes);
if (r != OK) if (r != OK)
panic(__FILE__, "el3_write_fifo: sys_safe_insb failed", r); panic(__FILE__, "el3_write_fifo: sys_safe_outsb failed", r);
if (++ix >= IOVEC_NR) { /* Next buffer of IO vector */ if (++ix >= IOVEC_NR) { /* Next buffer of IO vector */
dp_next_iovec(iovp); dp_next_iovec(iovp);

View File

@ -1,6 +1,7 @@
#include <assert.h> #include <assert.h>
/* /*
** File: eth.c Version 1.00, Jan. 14, 1997 ** File: dp.c Version 1.01, Oct. 17, 2007
** Original: eth.c Version 1.00, Jan. 14, 1997
** **
** Author: Giovanni Falzoni <gfalzoni@inwind.it> ** Author: Giovanni Falzoni <gfalzoni@inwind.it>
** **
@ -50,6 +51,11 @@
** +------------+---------+---------+---------------+ ** +------------+---------+---------+---------------+
** **
** $Id$ ** $Id$
**
** 2007-10-17: modified by jfdsmit@gmail.com
** added a third argument to the reply() function because not
** every reply should be of DL_TASK_REPLY (one should be
** DL_STAT_REPLY)
*/ */
#include "drivers.h" #include "drivers.h"
@ -92,10 +98,10 @@ static char DevName[] = "eth#?";
static void do_getname(message *mp); static void do_getname(message *mp);
/* /*
** Name: void reply(dpeth_t *dep, int err) ** Name: void reply(dpeth_t *dep, int err, int m_type)
** Function: Fills a DL_TASK_REPLY reply message and sends it. ** Function: Fills a reply message and sends it.
*/ */
static void reply(dpeth_t * dep, int err) static void reply(dpeth_t * dep, int err, int m_type)
{ {
message reply; message reply;
int status = FALSE; int status = FALSE;
@ -103,7 +109,7 @@ static void reply(dpeth_t * dep, int err)
if (dep->de_flags & DEF_ACK_SEND) status |= DL_PACK_SEND; if (dep->de_flags & DEF_ACK_SEND) status |= DL_PACK_SEND;
if (dep->de_flags & DEF_ACK_RECV) status |= DL_PACK_RECV; if (dep->de_flags & DEF_ACK_RECV) status |= DL_PACK_RECV;
reply.m_type = DL_TASK_REPLY; reply.m_type = m_type;
reply.DL_PORT = dep - de_table; reply.DL_PORT = dep - de_table;
reply.DL_PROC = dep->de_client; reply.DL_PROC = dep->de_client;
reply.DL_STAT = status /* | ((u32_t) err << 16) */; reply.DL_STAT = status /* | ((u32_t) err << 16) */;
@ -423,7 +429,7 @@ static void do_vwrite_s(message * mp)
} else if (dep->de_mode == DEM_SINK) } else if (dep->de_mode == DEM_SINK)
dep->de_flags |= DEF_ACK_SEND; dep->de_flags |= DEF_ACK_SEND;
reply(dep, OK); reply(dep, OK, DL_TASK_REPLY);
return; return;
} }
@ -466,7 +472,7 @@ static void do_vread_s(message * mp)
dep->de_flags &= NOT(DEF_STOPPED); dep->de_flags &= NOT(DEF_STOPPED);
#endif #endif
} }
reply(dep, OK); reply(dep, OK, DL_TASK_REPLY);
return; return;
} }
@ -491,7 +497,7 @@ static void do_getstat_s(message * mp)
(vir_bytes)&dep->de_stat, (vir_bytes)&dep->de_stat,
(vir_bytes) sizeof(dep->de_stat), 0)) != OK) (vir_bytes) sizeof(dep->de_stat), 0)) != OK)
panic(DevName, CopyErrMsg, rc); panic(DevName, CopyErrMsg, rc);
reply(dep, OK); reply(dep, OK, DL_STAT_REPLY);
return; return;
} }
@ -623,7 +629,7 @@ PUBLIC int main(int argc, char **argv)
dep->de_int_pending = TRUE; dep->de_int_pending = TRUE;
(*dep->de_interruptf) (dep); (*dep->de_interruptf) (dep);
if (dep->de_flags & (DEF_ACK_SEND | DEF_ACK_RECV)) if (dep->de_flags & (DEF_ACK_SEND | DEF_ACK_RECV))
reply(dep, !OK); reply(dep, !OK, DL_TASK_REPLY);
dep->de_int_pending = FALSE; dep->de_int_pending = FALSE;
sys_irqenable(&dep->de_hook); sys_irqenable(&dep->de_hook);
} }

View File

@ -148,7 +148,8 @@ int safe; /* safe copies */
return EPERM; 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 */ return OK; /* Beyond EOF */
position= cv64ul(pos64); position= cv64ul(pos64);

View File

@ -85,7 +85,7 @@ int main(void)
case BUSC_PCI_DEV_NAME_S: do_dev_name_s(&m); break; case BUSC_PCI_DEV_NAME_S: do_dev_name_s(&m); break;
case BUSC_PCI_SLOT_NAME_S: do_slot_name_s(&m); break; case BUSC_PCI_SLOT_NAME_S: do_slot_name_s(&m); break;
case BUSC_PCI_ACL: do_acl(&m); break; case BUSC_PCI_ACL: do_acl(&m); break;
case PROC_EVENT: do_sig_handler(); break; case PROC_EVENT: break;
default: default:
printf("PCI: got message from %d, type %d\n", printf("PCI: got message from %d, type %d\n",
m.m_source, m.m_type); m.m_source, m.m_type);
@ -140,10 +140,8 @@ message *mp;
{ {
/* Ignore all init calls for a process after the first one */ /* Ignore all init calls for a process after the first one */
} }
#if 0
else else
pci_release(names[i].name); pci_release(names[i].name);
#endif
names[i].tasknr= mp->m_source; names[i].tasknr= mp->m_source;
mp->m_type= 0; mp->m_type= 0;

View File

@ -387,7 +387,6 @@ char *name;
return OK; return OK;
} }
#if 0
/*===========================================================================* /*===========================================================================*
* pci_release * * pci_release *
*===========================================================================*/ *===========================================================================*/
@ -405,7 +404,6 @@ char *name;
pcidev[i].pd_inuse= 0; pcidev[i].pd_inuse= 0;
} }
} }
#endif
/*===========================================================================* /*===========================================================================*
* pci_ids * * pci_ids *

View File

@ -21,7 +21,7 @@ OBJ = printer.o
all build: $(DRIVER) all build: $(DRIVER)
$(DRIVER): $(OBJ) $(DRIVER): $(OBJ)
$(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS) $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
install -S 8k $(DRIVER) install $(DRIVER)
# install with other drivers # install with other drivers
install: /usr/sbin/$(DRIVER) install: /usr/sbin/$(DRIVER)

View File

@ -90,7 +90,7 @@ PRIVATE int revive_status; /* revive status */
PRIVATE int done_status; /* status of last output completion */ PRIVATE int done_status; /* status of last output completion */
PRIVATE int oleft; /* bytes of output left in obuf */ PRIVATE int oleft; /* bytes of output left in obuf */
PRIVATE char obuf[128]; /* output buffer */ PRIVATE char obuf[128]; /* output buffer */
PRIVATE char *optr; /* ptr to next char in obuf to print */ PRIVATE unsigned char *optr; /* ptr to next char in obuf to print */
PRIVATE int orig_count; /* original byte count */ PRIVATE int orig_count; /* original byte count */
PRIVATE int port_base; /* I/O port for printer */ PRIVATE int port_base; /* I/O port for printer */
PRIVATE int proc_nr; /* user requesting the printing */ PRIVATE int proc_nr; /* user requesting the printing */
@ -208,13 +208,16 @@ int safe; /* use virtual addresses or grant id's? */
retries = MAX_ONLINE_RETRIES + 1; retries = MAX_ONLINE_RETRIES + 1;
while (--retries > 0) { while (--retries > 0) {
sys_inb(port_base + 1, &status); if(sys_inb(port_base + 1, &status) != OK) {
printf("printer: sys_inb of %x failed\n", port_base+1);
panic(__FILE__,"sys_inb failed", NO_NUM);
}
if ((status & ON_LINE)) { /* printer online! */ if ((status & ON_LINE)) { /* printer online! */
prepare_output(); prepare_output();
do_printer_output(); do_printer_output();
return; return;
} }
tickdelay(30); /* wait before retry */ tickdelay(HZ/2); /* wait before retry */
} }
/* If we reach this point, the printer was not online in time. */ /* If we reach this point, the printer was not online in time. */
done_status = status; done_status = status;
@ -331,16 +334,24 @@ PRIVATE void do_initialize()
initialized = TRUE; initialized = TRUE;
/* Get the base port for first printer. */ /* Get the base port for first printer. */
sys_vircopy(SELF, BIOS_SEG, LPT1_IO_PORT_ADDR, if(sys_vircopy(SELF, BIOS_SEG, LPT1_IO_PORT_ADDR,
SELF, D, (vir_bytes) &port_base, LPT1_IO_PORT_SIZE); SELF, D, (vir_bytes) &port_base, LPT1_IO_PORT_SIZE) != OK) {
sys_outb(port_base + 2, INIT_PRINTER); panic(__FILE__, "do_initialize: sys_vircopy failed", NO_NUM);
tickdelay(1); /* easily satisfies Centronics minimum */ }
/* was 2 millisecs; now is ~17 millisecs */ if(sys_outb(port_base + 2, INIT_PRINTER) != OK) {
sys_outb(port_base + 2, PR_SELECT); printf("printer: sys_outb of %x failed\n", port_base+2);
panic(__FILE__, "do_initialize: sys_outb init failed", NO_NUM);
}
tickdelay(HZ/20); /* easily satisfies Centronics minimum */
if(sys_outb(port_base + 2, PR_SELECT) != OK) {
printf("printer: sys_outb of %x failed\n", port_base+2);
panic(__FILE__, "do_initialize: sys_outb select failed", NO_NUM);
}
irq_hook_id = 0; irq_hook_id = 0;
sys_irqsetpolicy(PRINTER_IRQ, 0, &irq_hook_id); if(sys_irqsetpolicy(PRINTER_IRQ, 0, &irq_hook_id) != OK ||
sys_irqenable(&irq_hook_id); sys_irqenable(&irq_hook_id) != OK) {
panic(__FILE__, "do_initialize: irq enabling failed", NO_NUM);
}
} }
/*==========================================================================* /*==========================================================================*
@ -389,8 +400,13 @@ PRIVATE void do_printer_output()
* when the printer is busy with a previous character, because the * when the printer is busy with a previous character, because the
* interrupt status does not affect the printer. * interrupt status does not affect the printer.
*/ */
sys_outb(port_base + 2, PR_SELECT); if(sys_outb(port_base + 2, PR_SELECT) != OK) {
sys_irqenable(&irq_hook_id); printf("printer: sys_outb of %x failed\n", port_base+2);
panic(__FILE__,"sys_outb failed", NO_NUM);
}
if(sys_irqenable(&irq_hook_id) != OK) {
panic(__FILE__,"sys_irqenable failed", NO_NUM);
}
return; return;
} }
@ -398,7 +414,10 @@ PRIVATE void do_printer_output()
/* Loop to handle fast (buffered) printers. It is important that /* Loop to handle fast (buffered) printers. It is important that
* processor interrupts are not disabled here, just printer interrupts. * processor interrupts are not disabled here, just printer interrupts.
*/ */
(void) sys_inb(port_base + 1, &status); if(sys_inb(port_base + 1, &status) != OK) {
printf("printer: sys_inb of %x failed\n", port_base+1);
panic(__FILE__,"sys_inb failed", NO_NUM);
}
if ((status & STATUS_MASK) == BUSY_STATUS) { if ((status & STATUS_MASK) == BUSY_STATUS) {
/* Still busy with last output. This normally happens /* Still busy with last output. This normally happens
* immediately after doing output to an unbuffered or slow * immediately after doing output to an unbuffered or slow
@ -406,15 +425,21 @@ PRIVATE void do_printer_output()
* pr_restart, since they are not synchronized with printer * pr_restart, since they are not synchronized with printer
* interrupts. It may happen after a spurious interrupt. * interrupts. It may happen after a spurious interrupt.
*/ */
sys_irqenable(&irq_hook_id); if(sys_irqenable(&irq_hook_id) != OK) {
panic(__FILE__, "sys_irqenable failed\n", NO_NUM);
}
return; return;
} }
if ((status & STATUS_MASK) == NORMAL_STATUS) { if ((status & STATUS_MASK) == NORMAL_STATUS) {
/* Everything is all right. Output another character. */ /* Everything is all right. Output another character. */
pv_set(char_out[0], port_base, *optr++); pv_set(char_out[0], port_base, *optr);
optr++;
pv_set(char_out[1], port_base+2, ASSERT_STROBE); pv_set(char_out[1], port_base+2, ASSERT_STROBE);
pv_set(char_out[2], port_base+2, NEGATE_STROBE); pv_set(char_out[2], port_base+2, NEGATE_STROBE);
sys_voutb(char_out, 3); /* request series of port outb */ if(sys_voutb(char_out, 3) != OK) {
/* request series of port outb */
panic(__FILE__, "sys_voutb failed\n", NO_NUM);
}
user_vir_d++; user_vir_d++;
user_left--; user_left--;
@ -422,7 +447,9 @@ PRIVATE void do_printer_output()
/* Error. This would be better ignored (treat as busy). */ /* Error. This would be better ignored (treat as busy). */
done_status = status; done_status = status;
output_done(); output_done();
sys_irqenable(&irq_hook_id); if(sys_irqenable(&irq_hook_id) != OK) {
panic(__FILE__, "sys_irqenable failed\n", NO_NUM);
}
return; return;
} }
} }
@ -431,6 +458,8 @@ PRIVATE void do_printer_output()
/* Finished printing chunk OK. */ /* Finished printing chunk OK. */
done_status = OK; done_status = OK;
output_done(); output_done();
sys_irqenable(&irq_hook_id); if(sys_irqenable(&irq_hook_id) != OK) {
panic(__FILE__, "sys_irqenable failed\n", NO_NUM);
}
} }

View File

@ -5,5 +5,5 @@
/usr/lib/em_opt 208000 /usr/lib/em_opt 208000
/usr/lib/i386/as 55000 /usr/lib/i386/as 55000
/usr/lib/i386/cg 50655 /usr/lib/i386/cg 50655
/bin/sh 102400 /bin/sh 142400
/usr/bin/make 337920 /usr/bin/make 380000

View File

@ -93,6 +93,7 @@ driver is
GETINFO # 26 GETINFO # 26
SETGRANT # 34 SETGRANT # 34
; ;
uid 0;
}; };
driver pci driver pci
@ -155,3 +156,26 @@ driver mfs
; ;
uid 0; 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
;
};

View File

@ -135,7 +135,8 @@ start)
echo -n "Starting networking:" echo -n "Starting networking:"
if grep -s 'psip0.*default' /etc/inet.conf if grep -s 'psip0.*default' /etc/inet.conf
then ifconfig -h 10.0.0.1 then ifconfig -h 10.0.0.1
else daemonize dhcpd else sleep 5
daemonize dhcpd
fi fi
daemonize nonamed -L daemonize nonamed -L
if [ -f "$DAEMONS" ] if [ -f "$DAEMONS" ]

View File

@ -228,6 +228,7 @@
#define DL_CONF_REPLY (DL_RS_BASE + 20) #define DL_CONF_REPLY (DL_RS_BASE + 20)
#define DL_TASK_REPLY (DL_RS_BASE + 21) #define DL_TASK_REPLY (DL_RS_BASE + 21)
#define DL_NAME_REPLY (DL_RS_BASE + 22) #define DL_NAME_REPLY (DL_RS_BASE + 22)
#define DL_STAT_REPLY (DL_RS_BASE + 23)
/* Field names for data link layer messages. */ /* Field names for data link layer messages. */
#define DL_PORT m2_i1 #define DL_PORT m2_i1

View File

@ -3,7 +3,7 @@
/* Minix release and version numbers. */ /* Minix release and version numbers. */
#define OS_RELEASE "3" #define OS_RELEASE "3"
#define OS_VERSION "1.3" #define OS_VERSION "1.3c"
/* This file sets configuration parameters for the MINIX kernel, FS, and PM. /* This file sets configuration parameters for the MINIX kernel, FS, and PM.
* It is divided up into two main sections. The first section contains * It is divided up into two main sections. The first section contains
@ -53,7 +53,7 @@
#endif #endif
#if (MACHINE == IBM_PC && _WORD_SIZE == 4) #if (MACHINE == IBM_PC && _WORD_SIZE == 4)
#define NR_BUFS 1200 /* # blocks in the buffer cache */ #define NR_BUFS 500 /* # blocks in the buffer cache */
#define NR_BUF_HASH 2048 /* size of buf hash table; MUST BE POWER OF 2*/ #define NR_BUF_HASH 2048 /* size of buf hash table; MUST BE POWER OF 2*/
#endif #endif

View File

@ -30,6 +30,7 @@ register message *m_ptr; /* pointer to request message */
phys_bytes bytes; /* number of bytes to copy */ phys_bytes bytes; /* number of bytes to copy */
int i; int i;
#if 0
if (m_ptr->m_source != 0 && m_ptr->m_source != 1 && if (m_ptr->m_source != 0 && m_ptr->m_source != 1 &&
m_ptr->m_source != 2 && m_ptr->m_source != 3) 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); m_ptr->CP_DST_SPACE);
} }
} }
#endif
/* Dismember the command message. */ /* Dismember the command message. */
vir_addr[_SRC_].proc_nr_e = m_ptr->CP_SRC_ENDPT; vir_addr[_SRC_].proc_nr_e = m_ptr->CP_SRC_ENDPT;

View File

@ -20,7 +20,7 @@ PUBLIC struct mproc mproc[NR_PROCS];
*===========================================================================*/ *===========================================================================*/
PRIVATE char *flags_str(int flags) PRIVATE char *flags_str(int flags)
{ {
static char str[10]; static char str[13];
str[0] = (flags & WAITING) ? 'W' : '-'; str[0] = (flags & WAITING) ? 'W' : '-';
str[1] = (flags & ZOMBIE) ? 'Z' : '-'; str[1] = (flags & ZOMBIE) ? 'Z' : '-';
str[2] = (flags & PAUSED) ? 'P' : '-'; str[2] = (flags & PAUSED) ? 'P' : '-';

View File

@ -59,8 +59,8 @@ PUBLIC int main(int argc, char **argv)
} }
continue; continue;
case PROC_EVENT: case PROC_EVENT:
sig_handler(); result = EDONTREPLY;
continue; break;
case FKEY_PRESSED: case FKEY_PRESSED:
result = do_fkey_pressed(&m_in); result = do_fkey_pressed(&m_in);
break; break;

View File

@ -350,12 +350,10 @@ PUBLIC int fs_rename()
} }
next_new_superdirp = advance(&new_superdirp, dot2); next_new_superdirp = advance(&new_superdirp, dot2);
put_inode(new_superdirp); put_inode(new_superdirp);
/*
if (next_new_superdirp == new_superdirp) { if (next_new_superdirp == new_superdirp) {
put_inode(new_superdirp); put_inode(new_superdirp);
break; break;
} }
*/
if (err_code == ELEAVEMOUNT) { if (err_code == ELEAVEMOUNT) {
/* imitate that we are back at the root, /* imitate that we are back at the root,
* cross device checked already on VFS */ * cross device checked already on VFS */

View File

@ -82,7 +82,7 @@ int flags; /* extra flags, if any */
* arguments vector is: path, arguments, NULL. * arguments vector is: path, arguments, NULL.
*/ */
arg_count = 0; /* initialize arg count */ 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 */ cmd_ptr = rp->r_cmd; /* do some parsing */
while(*cmd_ptr != '\0') { /* stop at end of string */ while(*cmd_ptr != '\0') { /* stop at end of string */
if (*cmd_ptr == ' ') { /* next argument */ if (*cmd_ptr == ' ') { /* next argument */
@ -184,7 +184,7 @@ message *m_ptr; /* request message pointer */
* arguments vector is: path, arguments, NULL. * arguments vector is: path, arguments, NULL.
*/ */
arg_count = 0; /* initialize arg count */ 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 */ cmd_ptr = rp->r_cmd; /* do some parsing */
while(*cmd_ptr != '\0') { /* stop at end of string */ while(*cmd_ptr != '\0') { /* stop at end of string */
if (*cmd_ptr == ' ') { /* next argument */ if (*cmd_ptr == ' ') { /* next argument */
@ -720,8 +720,9 @@ endpoint_t *endpoint;
setuid(rp->r_uid); setuid(rp->r_uid);
if (!use_copy) if (!use_copy)
{ {
execve(rp->r_argv[0], rp->r_argv, NULL); /* POSIX execute */ rp->r_argv[0] = rp->r_label;
file_only = strrchr(rp->r_argv[0], '/') + 1; 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 */ execve(file_only, rp->r_argv, NULL); /* POSIX execute */
} }
printf("RS: exec failed for %s: %d\n", rp->r_argv[0], errno); printf("RS: exec failed for %s: %d\n", rp->r_argv[0], errno);

View File

@ -42,6 +42,7 @@ extern struct rproc {
char r_cmd[MAX_COMMAND_LEN]; /* raw command plus arguments */ char r_cmd[MAX_COMMAND_LEN]; /* raw command plus arguments */
char r_script[MAX_SCRIPT_LEN]; /* name of the restart script executable */ char r_script[MAX_SCRIPT_LEN]; /* name of the restart script executable */
char *r_argv[MAX_NR_ARGS+2]; /* parsed arguments vector */ char *r_argv[MAX_NR_ARGS+2]; /* parsed arguments vector */
char *r_file; /* path to binary to exec */
int r_argc; /* number of arguments */ int r_argc; /* number of arguments */
/* Resources */ /* Resources */

View File

@ -86,7 +86,6 @@
#define DIR_ENTRY_SIZE usizeof (struct direct) /* # bytes/dir entry */ #define DIR_ENTRY_SIZE usizeof (struct direct) /* # bytes/dir entry */
#define NR_DIR_ENTRIES(b) ((b)/DIR_ENTRY_SIZE) /* # dir entries/blk */ #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 PIPE_SIZE(b) (V1_NR_DZONES*(b)) /* pipe size in bytes */
#define FS_BITMAP_CHUNKS(b) ((b)/usizeof (bitchunk_t))/* # map chunks/blk */ #define FS_BITMAP_CHUNKS(b) ((b)/usizeof (bitchunk_t))/* # map chunks/blk */

View File

@ -37,7 +37,7 @@
FORWARD _PROTOTYPE( int safe_io_conversion, (endpoint_t, FORWARD _PROTOTYPE( int safe_io_conversion, (endpoint_t,
cp_grant_id_t *, int *, cp_grant_id_t *, int, 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 *, FORWARD _PROTOTYPE( void safe_io_cleanup, (cp_grant_id_t, cp_grant_id_t *,
int)); int));
@ -170,7 +170,7 @@ PUBLIC void dev_status(message *m)
* safe_io_conversion * * safe_io_conversion *
*===========================================================================*/ *===========================================================================*/
PRIVATE int safe_io_conversion(driver, gid, op, gids, gids_size, 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; endpoint_t driver;
cp_grant_id_t *gid; cp_grant_id_t *gid;
int *op; int *op;
@ -180,7 +180,7 @@ endpoint_t *io_ept;
void **buf; void **buf;
int *vec_grants; int *vec_grants;
vir_bytes bytes; vir_bytes bytes;
off_t *pos; u32_t *pos_lo;
{ {
int access = 0, size; int access = 0, size;
int j; int j;
@ -242,7 +242,7 @@ off_t *pos;
*buf = new_iovec; *buf = new_iovec;
break; break;
case VFS_DEV_IOCTL: 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; *op = DEV_IOCTL_S;
if(_MINIX_IOCTL_IOR(m_in.REQUEST)) access |= CPF_WRITE; if(_MINIX_IOCTL_IOR(m_in.REQUEST)) access |= CPF_WRITE;
if(_MINIX_IOCTL_IOW(m_in.REQUEST)) access |= CPF_READ; if(_MINIX_IOCTL_IOW(m_in.REQUEST)) access |= CPF_READ;
@ -303,6 +303,7 @@ int gids_size;
return; return;
} }
#if 0
/*===========================================================================* /*===========================================================================*
* dev_bio * * dev_bio *
*===========================================================================*/ *===========================================================================*/
@ -420,22 +421,23 @@ int bytes; /* how many bytes to transfer */
return(m.REP_STATUS); return(m.REP_STATUS);
} }
} }
#endif
/*===========================================================================* /*===========================================================================*
* dev_io * * 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. */ int op; /* DEV_READ, DEV_WRITE, DEV_IOCTL, etc. */
dev_t dev; /* major-minor device number */ dev_t dev; /* major-minor device number */
int proc_e; /* in whose address space is buf? */ int proc_e; /* in whose address space is buf? */
void *buf; /* virtual address of the buffer */ 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 bytes; /* how many bytes to transfer */
int flags; /* special flags, like O_NONBLOCK */ int flags; /* special flags, like O_NONBLOCK */
{ {
/* Read or write from a device. The parameter 'dev' tells which one. */ /* Read or write from a device. The parameter 'dev' tells which one. */
struct dmap *dp; struct dmap *dp;
off_t pos; u32_t pos_lo, pos_high;
message dev_mess; message dev_mess;
cp_grant_id_t gid = GRANT_INVALID; cp_grant_id_t gid = GRANT_INVALID;
static cp_grant_id_t gids[NR_IOREQS]; static cp_grant_id_t gids[NR_IOREQS];
@ -443,9 +445,8 @@ int flags; /* special flags, like O_NONBLOCK */
void *buf_used; void *buf_used;
endpoint_t ioproc; endpoint_t ioproc;
if (ex64hi(posX) != 0) pos_lo= ex64lo(pos);
panic(__FILE__, "dev_io: postition too high", NO_NUM); pos_high= ex64hi(pos);
pos= ex64lo(posX);
/* Determine task dmap. */ /* Determine task dmap. */
dp = &dmap[(dev >> MAJOR) & BYTE]; dp = &dmap[(dev >> MAJOR) & BYTE];
@ -471,7 +472,7 @@ int flags; /* special flags, like O_NONBLOCK */
buf_used = buf; buf_used = buf;
safe = safe_io_conversion(dp->dmap_driver, &gid, safe = safe_io_conversion(dp->dmap_driver, &gid,
&op, gids, NR_IOREQS, &dev_mess.IO_ENDPT, &buf_used, &op, gids, NR_IOREQS, &dev_mess.IO_ENDPT, &buf_used,
&vec_grants, bytes, &pos); &vec_grants, bytes, &pos_lo);
if(buf != buf_used) if(buf != buf_used)
panic(__FILE__,"dev_io: safe_io_conversion changed buffer", NO_NUM); 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. */ /* Set up the rest of the message passed to task. */
dev_mess.m_type = op; dev_mess.m_type = op;
dev_mess.DEVICE = (dev >> MINOR) & BYTE; dev_mess.DEVICE = (dev >> MINOR) & BYTE;
dev_mess.POSITION = pos; dev_mess.POSITION = pos_lo;
dev_mess.COUNT = bytes; dev_mess.COUNT = bytes;
dev_mess.HIGHPOS = 0; dev_mess.HIGHPOS = pos_high;
/* This will be used if the i/o is suspended. */ /* This will be used if the i/o is suspended. */
ioproc = dev_mess.IO_ENDPT; ioproc = dev_mess.IO_ENDPT;

View File

@ -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 */

View File

@ -319,8 +319,10 @@ PRIVATE void init_root()
last_login_fs_e = NONE; last_login_fs_e = NONE;
/* Initialize vmnt table */ /* 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_dev = NO_DEV;
vmp->m_fs_e = NONE;
}
vmp = &vmnt[0]; vmp = &vmnt[0];
@ -411,7 +413,7 @@ PRIVATE void service_pm()
/* Send new time for all FS processes */ /* Send new time for all FS processes */
for (vmp = &vmnt[0]; vmp < &vmnt[NR_MNTS]; ++vmp) { 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); req_stime(vmp->m_fs_e, boottime);
} }
/* No need to report status to PM */ /* No need to report status to PM */

View File

@ -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 */

View File

@ -72,7 +72,7 @@ PUBLIC int do_stime()
/* Send new time for all FS processes */ /* Send new time for all FS processes */
for (vmp = &vmnt[0]; vmp < &vmnt[NR_MNTS]; ++vmp) { 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; return OK;

View File

@ -3,6 +3,8 @@
* Jul 2006 (Balazs Gerofi) * Jul 2006 (Balazs Gerofi)
*/ */
#include <minix/com.h>
#include "fs.h" #include "fs.h"
#include "vmnt.h" #include "vmnt.h"
@ -27,6 +29,8 @@ PUBLIC struct vmnt *get_free_vmnt(short *index)
PUBLIC struct vmnt *find_vmnt(int fs_e) PUBLIC struct vmnt *find_vmnt(int fs_e)
{ {
struct vmnt *vp; 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) { for (vp = &vmnt[0]; vp < &vmnt[NR_MNTS]; ++vp) {
if (vp->m_fs_e == fs_e) return vp; if (vp->m_fs_e == fs_e) return vp;
} }

View File

@ -127,8 +127,8 @@ char *argv[];
exit(1); exit(1);
} }
system("rm -rf DIR_18; mkdir DIR_18"); system("rm -rf DIR_17; mkdir DIR_17");
chdir("DIR_18"); chdir("DIR_17");
mask = (argc == 2 ? atoi(argv[1]) : 0xFFFF); mask = (argc == 2 ? atoi(argv[1]) : 0xFFFF);

View File

@ -131,7 +131,7 @@ void test23a()
if (chdir(".//.//") != 0) e(39); /* .//.// == current dir */ if (chdir(".//.//") != 0) e(39); /* .//.// == current dir */
if (getcwd(buf, PATH_MAX) != buf) e(40); if (getcwd(buf, PATH_MAX) != buf) e(40);
if (strcmp(buf, cwd) != 0) e(41); /* we might be at '/' */ 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 /* 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 * 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. * a size related to PATH_MAX, NAME_MAX or the size required.

View File

@ -10,9 +10,6 @@ rm /boot/image/*
make install make install
cp /boot/image/* /boot/image_big # Make big image accessible by this name cp /boot/image/* /boot/image_big # Make big image accessible by this name
cp ../boot/boot /boot/boot cp ../boot/boot /boot/boot
make clean
make image_small
cp image_small /boot
cd /usr/src cd /usr/src
make clean make clean
# Let man find the manpages # Let man find the manpages

View File

@ -183,12 +183,24 @@ cdfdboot)
mkdir /mnt/boot mkdir /mnt/boot
mkdir /mnt/boot/image mkdir /mnt/boot/image
( cd /mnt/dev && sh /usr/src/commands/scripts/MAKEDEV.sh std ) ( cd /mnt/dev && sh /usr/src/commands/scripts/MAKEDEV.sh std )
#cp -p image image_* /mnt/boot/image || exit 1
cp -p image /mnt/boot/image || exit 1 cp -p image /mnt/boot/image || exit 1
cp -p ../boot/boot /mnt/boot/boot || exit 1 cp -p ../boot/boot /mnt/boot/boot || exit 1
umount $dev || exit 1 umount $dev || exit 1
installboot -d $dev ../boot/bootblock boot/boot || exit 1 installboot -d $dev ../boot/bootblock boot/boot || exit 1
edparams $dev 'unset bootopts; unset servers; disable=inet; image=/boot/image/image; bootbig(1, Regular MINIX 3) { image=/boot/image/image ; boot } bootsmall(2, Small MINIX 3 (uses less memory)) { image=/boot/image/image_small ; boot } cdproberoot=1; ata_id_timeout=2; unset rootdev; unset leader; leader() { echo \n--- Welcome to MINIX 3. This is the boot monitor. ---\n\nChoose an option from the menu or press ESC if you need to do anything special.\nOtherwise I will boot with my defaults in 10 seconds.\n\n }; bootcd=1; main(){trap 10000 boot; menu; }; save' || exit edparams $dev '
unset bootopts;
unset servers;
unset rootdev;
unset leader;
unset image;
disable=inet;
bootcd=1;
cdproberoot=1;
ata_id_timeout=2;
bootbig(1, MINIX 3) { unset image; boot }
leader() { echo \n--- Welcome to MINIX 3. This is the boot monitor. ---\n\nChoose an option from the menu or press ESC if you need to do anything special.\nOtherwise I will boot with my defaults in 10 seconds.\n\n };
main(){trap 10000 boot; menu; };
save' || exit
# copy image # copy image
dd if=$dev of=cdfdimage bs=8192 count=180 dd if=$dev of=cdfdimage bs=8192 count=180

View File

@ -50,8 +50,7 @@ disable=inet
bios_wini=yes bios_wini=yes
bios_remap_first=1 bios_remap_first=1
ramimagedev=c0d7p0s0 ramimagedev=c0d7p0s0
bootbig(1, Regular MINIX 3) { image=/boot/image_big; boot } bootbig(1, MINIX 3) { image=/boot/image_big; boot }
bootsmall(2, Small MINIX 3 (<16MB)) {image=/boot/image_small; boot }
main() { trap 10000 boot ; menu; } main() { trap 10000 boot ; menu; }
save' | $RELEASEDIR/usr/bin/edparams $TMPDISK3 save' | $RELEASEDIR/usr/bin/edparams $TMPDISK3
@ -95,11 +94,13 @@ SVNREV=""
REVTAG="" REVTAG=""
PACKAGES=1 PACKAGES=1
while getopts "pchu?r:" c FILENAMEOUT=""
while getopts "s:pchu?r:f:" c
do do
case "$c" in 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 exit 1
;; ;;
h) h)
@ -123,10 +124,15 @@ do
HDEMU=1 HDEMU=1
USB=1 USB=1
;; ;;
f)
FILENAMEOUT="$OPTARG"
;;
s) USERNAME="--username=$OPTARG"
;;
esac esac
done done
USRMB=400 USRMB=580
USRBLOCKS="`expr $USRMB \* 1024 \* 1024 / $BS`" USRBLOCKS="`expr $USRMB \* 1024 \* 1024 / $BS`"
USRSECTS="`expr $USRMB \* 1024 \* 2`" USRSECTS="`expr $USRMB \* 1024 \* 2`"
@ -214,7 +220,7 @@ then
fi fi
echo " * Cleanup old files" 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 $CDFILES || exit
mkdir -p $RELEASEDIR mkdir -p $RELEASEDIR
mkfs -B $BS -b $ROOTBLOCKS $TMPDISK3 || exit mkfs -B $BS -b $ROOTBLOCKS $TMPDISK3 || exit
@ -225,6 +231,7 @@ mkdir -m 755 $RELEASEDIR/usr
mkdir -m 1777 $RELEASEDIR/tmp mkdir -m 1777 $RELEASEDIR/tmp
mount $TMPDISK2 $RELEASEDIR/tmp mount $TMPDISK2 $RELEASEDIR/tmp
echo making /usr
mkfs -B $BS -b $USRBLOCKS $TMPDISK || exit mkfs -B $BS -b $USRBLOCKS $TMPDISK || exit
echo " * Mounting $TMPDISK as $RELEASEDIR/usr" echo " * Mounting $TMPDISK as $RELEASEDIR/usr"
mount $TMPDISK $RELEASEDIR/usr || exit mount $TMPDISK $RELEASEDIR/usr || exit
@ -279,10 +286,11 @@ chmod -R u+w $RELEASEDIR/usr/lib
if [ "$COPY" -ne 1 ] if [ "$COPY" -ne 1 ]
then then
echo " * Doing new svn export" echo " * Doing new svn export"
REPO=https://gforge.cs.vu.nl/svn/minix/trunk/$SRC BRANCH=r3.1.3
REVISION="`svn info $SVNREV $REPO | grep '^Revision: ' | awk '{ print $2 }'`" REPO=https://gforge.cs.vu.nl/svn/minix/branches/$BRANCH
REVISION="`svn info $USERNAME $SVNREV $REPO | grep '^Revision: ' | awk '{ print $2 }'`"
echo "Doing export of revision $REVISION from $REPO." 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 && mv $BRANCH $SRC )
REVTAG=r$REVISION REVTAG=r$REVISION
echo " echo "
@ -303,8 +311,6 @@ if [ "$USB" -ne 0 ]; then
else else
IMG=${IMG_BASE}_${REVTAG}.iso IMG=${IMG_BASE}_${REVTAG}.iso
fi fi
IMGBZ=${IMG}.bz2
echo "Making $IMGBZ"
echo " * Fixups for owners and modes of dirs and files" echo " * Fixups for owners and modes of dirs and files"
chown -R bin $RELEASEDIR/usr/$SRC chown -R bin $RELEASEDIR/usr/$SRC
@ -321,7 +327,10 @@ if [ "$USB" -eq 0 ]
then date >$RELEASEDIR/CD then date >$RELEASEDIR/CD
fi fi
echo " * Chroot build" echo " * Chroot build"
cp chrootmake.sh $RELEASEDIR/usr/$SRC/tools/chrootmake.sh
chroot $RELEASEDIR "PATH=/$XBIN sh -x /usr/$SRC/tools/chrootmake.sh" || exit 1 chroot $RELEASEDIR "PATH=/$XBIN sh -x /usr/$SRC/tools/chrootmake.sh" || exit 1
# Copy built images for cd booting
cp $RELEASEDIR/boot/image_big image
echo " * Chroot build done" echo " * Chroot build done"
echo " * Removing bootstrap files" echo " * Removing bootstrap files"
rm -rf $RELEASEDIR/$XBIN rm -rf $RELEASEDIR/$XBIN
@ -337,7 +346,7 @@ then
hdemu_root_changes hdemu_root_changes
fi fi
echo $version_pretty >$RELEASEDIR/etc/version echo $version_pretty, SVN revision $SVNREV, generated `date` >$RELEASEDIR/etc/version
echo " * Counting files" echo " * Counting files"
extrakb=`du -s $RELEASEDIR/usr/install | awk '{ print $1 }'` extrakb=`du -s $RELEASEDIR/usr/install | awk '{ print $1 }'`
expr `df $TMPDISK | tail -1 | awk '{ print $4 }'` - $extrakb >$RELEASEDIR/.usrkb expr `df $TMPDISK | tail -1 | awk '{ print $4 }'` - $extrakb >$RELEASEDIR/.usrkb
@ -354,17 +363,9 @@ rm $RELEASEDIR/.x
umount $TMPDISK || exit umount $TMPDISK || exit
umount $TMPDISK2 || exit umount $TMPDISK2 || exit
umount $TMPDISK3 || exit umount $TMPDISK3 || exit
(cd ../boot && make) (cd ../boot && make)
(cd .. && make depend)
make clean
SVNVAR=EXTRA_OPTS=-D_SVN_REVISION='\\\"'$REVISION'\\\"'
make "$SVNVAR" image || exit 1
mv image image_big
make clean
make "$SVNVAR" image_small || exit 1
dd if=$TMPDISK3 of=$ROOTIMAGE bs=$BS count=$ROOTBLOCKS dd if=$TMPDISK3 of=$ROOTIMAGE bs=$BS count=$ROOTBLOCKS
# Prepare image and image_small for cdfdboot
mv image_big image
sh mkboot cdfdboot $TMPDISK3 sh mkboot cdfdboot $TMPDISK3
cp $IMAGE $CDFILES/bootflop.img cp $IMAGE $CDFILES/bootflop.img
cp release/cd/* $CDFILES || true cp release/cd/* $CDFILES || true
@ -403,3 +404,7 @@ else
partition -m $IMG 0 81:$isosects 81:$ROOTSECTS 81:$USRSECTS partition -m $IMG 0 81:$isosects 81:$ROOTSECTS 81:$USRSECTS
fi fi
fi fi
if [ "$FILENAMEOUT" ]
then echo "$IMG" >$FILENAMEOUT
fi