Minix

更新时间:2023-06-05 01:02:19 阅读: 评论:0

Solaris-Minix 2.0.0 Ur Guide for COP 4600
© 1998 Timothy A. Davis
CISE Department
University of Florida
Revid: January 2000
This document describes how to run, modify, and compile Solaris-Minix 2.0.0 on the CISE departmental computers.  See Operating Systems: Design and Implementation, A. S. Tanenbaum, Prentice-Hall, 2nd edition, and Smx - the Solaris port of Minix, P. Ashton, for more details.  The latter document, as well as this document, are located in
/ci/class/cop4600/minix/doc.
Registering for a Minix Directory
Before you may begin working with Minix, you must sign up for a Minix directory by visiting www.c
i.ufl.edu/~mconnor/cop4600/ and filling out the form.  This form requires you to have already obtained a valid CISE account.  For instructions on obtaining a CISE account, visit the computer lab in room CSE 114 and ask the person(s) at the help desk for assistance.
After completing the online registration form, you will be placed on a waiting list for a Minix directory.  Every few days (depending on the number of persons on the waiting list), the list is nt to the system administrators to be procesd.  The system administrators will create a directory for you, located at /ci/class/cop4600/class/<urname>, in which your copy of Minix will later reside.  For instance, if your urname is mconnor, your Minix directory will be
/ci/class/cop4600/class/mconnor.  You should check for this directory every day or two.  You may or may not receive an email notifying you when your directory has been created.
Registering for a Minix directory is a very important step, which should be completed within the first couple weeks of class.  In addition to creating a Minix directory for you, registration will place you in the class roster that will be ud to create the grade spreadsheet.
Setting Up Your Minix Directory
Run minix_tup
The command minix_tup places a copy of Solaris-Minix 2.0.0 in your COP 4600 directory and configures it for your u.  It also creates a symbolic link to this directory from your home directory, with the name cop4600. To get to your COP 4600 directory, you can either type
cd /ci/class/cop4600/class/$ur
or the more simple form,
cd ~/cop4600
A few rules regarding the u of you Minix directory:
• U it for COP 4600 only.  All other material will be deleted, possibly without warning!
The directory will be deleted at the end of the mester.
• Keep your directory protected, so that other students can't read it.  This is the default, but if you mess up the protections, type minix_protect to restore them.
优良作风Running Minix
Type cd ~/cop4600/src/tools
Run minix
Login as root
The minix command
From your COP 4600 directory, cd to the src/tools directory, and type minix.  You can do this in any sized X-window, but 80-by-24 is best if you want to u an editor in Minix.  Note that you won't need to compile any code inside Minix.  In fact, there is no compiler inside Minix.  The Minix source code editing and compilation are done outside of Minix (in src/kernel, etc.). You will e something like the following when you run minix:
% minix
lock file: /ci/class/cop4600/class/davis/lockfile
RAM file is /tmp/minixAAAa001rO, of size 3407872 bytes
Loading module kernel from ./image ... ok
Loading module mm from ./image ... ok
Loading module fs from ./image ... ok
Loading module inet from ./image ... ok
Loading module init from ./image ... ok
Minix 2.0.0  Copyright 1997 Prentice-Hall, Inc.金刚藤的功效
eth_init0: got reply for wrong port
arp.c: unable to open ethernet
ip.c: unable to open eth port
Memory size = 3328K  MINIX = 1176K  RAM disk = 0K  Available = 2152K
/dev/hdx1 is read-only mounted on /usr/bin
/dev/hdx2 is read-only mounted on /usr/man
Starting standard daemons: update.
--------------------------------------------------------------------------------
Welcome to Solaris-Minix, modified for COP 4600 by Prof. Tim Davis, Sept. 1997.
Valid logins are root (superur), bin (owner of binaries), and ast.  No
passwords are required.  To exit minix, type "shutdown" as root or bin.
--------------------------------------------------------------------------------
Solaris-Minix  Relea 2.0 Version 0幼儿园学期工作总结
noname login:
Ignore the ethernet error messages. Log in as root (you can also log in as bin or ast). No passwords are required. You have access to three Minix file systems while running Minix.
Type df and you'll e:
# df
Device    Inodes  Inodes  Inodes    Blocks  Blocks  Blocks  Mounted      V Pr
total  ud    free      total  ud    free      on
-----  -----  -----      -----  -----  -----  -------      - --
/dev/hdx0  1376    189    ****      ****    3078    1018  /            2 rw
/dev/hdx1  3424    212    3212      10240    9792    448  /usr/bin    2 ro
/dev/hdx2    688    382    306      2048    1443    605  /usr/man    2 ro
#
The three file systems shown above are three single *files* in Solaris. The root file system (4 Mbytes, or 4096 1K Blocks) is your own copy, in disks/root. You can both read and write to this file system.  If you corrupt this file system, you can get a fresh copy with the command (typed while *outside* Minix):
cp /ci/class/cop4600/minix/disks/root ~/cop4600/disks
The other two, /usr/bin and /usr/man, are read-only (e the last column of the df output). You share them with all other students. Type cd ; dir -R | more to e everything in the three file systems (dir is an alias for ls).  Everything you e in this directory listing is in one of the three Solaris files, disks/root, disks/usrbin, or disks/man. Typing ps -alx will show you all the tasks, rver process, and ur process:
F S UID  PID  PPID  PGRP  SZ      RECV TTY  TIME CMD
10 W  0    0    0    0  192        ANY  ?  0:00 TTY
10 W  0    0    0    0  192        ANY  ?  0:00 DP8390
10 W  0    0    0    0  192      CLOCK  ?  0:00 SYN_AL
0 R  0    0    0    0  192              ?  0:08 IDLE友善的交谈
10 W  0    0    0    0  192        ANY  ?  0:00 PRINTER
10 W  0    0    0    0  192        ANY  ?  0:01 HDDISK
0 R  0    0    0    0  192              ?  0:00 MEMORY
医学论文格式
10 W  0    0    0    0  192        ANY  ?  0:00 CLOCK
10 W  0    0    0    0  192        ANY  ?  0:00 SYS
0 R  0    0    0    0  192              ?  0:00 HARDWAR
10 W  0    0    0    0  104        ANY  ?  0:00 MM
10 W  0    0    0    0  616    MEMORY  ?  0:00 FS
10 W  0    0    0    0  224        ANY  ?  0:00 INET
10 S  0    1    0    0  40  (wait) MM  ?  0:00 INIT
10 S  0    29    1    29  64  (wait) MM  co  0:00 -sh
10 W  0    18    1    0  24        MM  ?  0:00 update
10 S  0    30    1    30  32  (TTY) FS  c1  0:00 getty
10 S  0    31    1    31  32  (TTY) FS  c2  0:00 getty
10 S  0    32    1    32  32  (TTY) FS  c3  0:00 getty
10 W  0    35    29    29  152        FS  co  0:00 ps -alx
The first ten are the system tasks.  A "task'' is Tanenbaum's name for a system thread running inside the kernel code.  They all share the same code, and are thus the same size (192K).  The next three (MM, FS, and INET) are rver process. They receive all the system calls made by ur process.  INIT is the first ur process, and is the ancestor of all other ur process.  Next you e –sh, which is the shell ud by root; update, which flushes the disk cache every 30 conds; three getty's, which are waiting for someone to type mlogin; and finally the
ps –alx command.  Type man ps for a description of the output.
You can u an X-window of any size to run Minix.  If you change the X-window size to 90-by-67, for example, then type (in Minix):
# stty rows 67
# stty cols 90
西安小吃街Changing the number of rows is uful primarily for reading "man'' pages in Minix.  There are four Minix editors: elvis (with synonyms vi, ex, and view), elle (with synonym emacs), uemacs (Micro Emacs), and mined, the MINix EDitor. Only mined tolerates the larger windows properly. Fortunately, you will almost never need to edit any files inside Minix. Even if you do, you could
sunwrite them from Minix to Solaris, edit them in Solaris, and then sunread them back into Minix (e below).  You can find out about the editors from the man pages while running Minix (try typing man mined, for example).
You can have multiple logins into one Minix instance.  For example, go to another X-window in Solaris and type mlogin $ur where $ur can be typed as is, or you can type your login name instead.  If I type this command, I get:
Connected to host davis
Solaris-Minix  Relea 2.0 Version 0
noname login:
Note the "hostname'' is davis in this ca, since this is my copy of Minix.  The name of your copy of
Minix is defined in your src/tools/.minix configuration file.  No one but you will be able to log into your copy of Minix.  Log in as bin, and type who:
$ who
root      console  Fri Sep 12 17:20
bin      ttyc1    Fri Sep 12 17:24
To log out, hit control-D. To terminate an mlogin ssion, type control-Q control-U control-I control-T, in quence. To terminate the entire Minix instance, including all mlogin ssions, type shutdown as either the ur root or the ur bin, or type halt as the ur root. The reboot and shutdown -R commands restart Minix (on a PC), but cau Solaris-Minix to shutdown. To avoid corrupting your root file system, do not terminate Minix in any other way except by using shutdown, halt, or reboot.
Plea note that while you may u multiple mlogin’s to run multiple shells within the same Minix instance, you should never run multiple minix’s at the same time.  The minix command should prevent you from doing this accidentally, but you should take caution to avoid this on your own.
The syschecks and killminix commands
You can only run one copy of Minix at a time (running two of them would corrupt your root file system).  If you try to do so, you will get an error message, telling you on what computer it thinks the other copy is running on. To shut down Minix safely, log into that computer, and then type mlogin $ur.  Log in as root and type halt.  This is the safest way of shutting down Minix.
If this fails, then you can locate the process id's of the Minix simulator with the syschecks command and then kill them with the kill -9 pid1 pid2 command, where pid1 and pid2 are the process id's of the two process.  The syschecks command takes a while, since it interrogates every computer in the CISE network that you can normally log in to (you can u the syscheck command to find just tho Minix process on the computer you are currently logged into).  You will also need to delete your lock file, with the command
cd ; cd cop4600 ; rm lockfile
Do this as a last resort, since kill will leave your root file system corrupted.
Alternatively, you can type killminix.  This command us the syschecks command to find your Minix process, and then kills them for you.  It also deletes your lock file. Do this as a last
resort, since killminix will leave your root file system corrupted.
叠小船
If your root file system is corrupted, you can get a fresh copy by typing:
cp /ci/class/cop4600/minix/disks/root ~/cop4600/disks
This is not a rious as it looks, since none of your Minix source code is located in your root file system.  Even your Minix ur programs are normally written outside Minix itlf. Typically, the only things you lo are the files that you have previously sunread into the root file system - which are normally just binary executables, copies of which are in your normal Solaris directory (usually cop4600/src/tools).
If Minix is killed, the next time you run Minix you may get a message:
The system was not properly shut down.  Checking file systems. This is followed by a report on what fsck, the file system checker, has found.  The fsck program is usually able to repair any damage done.
The syschecks and killminix commands only check tho CISE Solaris computers that students normally have access to.  It's possible that they could miss one, if a new computer is installed or if you have access beyond that of a typical student.  U the commands with caution.
[Revision Note: The syschecks and killminix commands rely on a pre-determined list of hostnames within the CISE network.  Since the original writing of this document, many hostnames have changed or been added to the network, meaning the computers will not be checked by syschecks or killminix.  For example, sand is not listed among the computers checked.  For this reason, it is advid that you avoid u of syschecks and killminix and take a more responsible approach: keep track of which systems you may have left runaway Minix process on and remove tho process yourlf.]
Runaway Minix Process
Occasionally when running Minix, it will hang (or freeze) or enter an infinite loop, and you will be forced to terminate Minix abruptly.  Sometimes, when dialing in from home, you may be disconnected while running Minix.  Whatever the circumstance, there are going to be occasions on which you do not exit Minix properly (using the halt or shutdown commands from within Minix).  When this happens, you should immediately log into the computer you were previously logged in to (the one on which you were running Minix) and attempt to shutdown Minix correctly using the mlogin command as described above.  If this fails, you should run the
氢氧化钙和稀盐酸minix_cleanup command to kill all ‘runaway’ Minix process.  Failure to do this may result in the system administrators banning you from using many CISE computers.
It is your responsibility to share the computing resources provided by CISE.  Since Minix consumes a considerable amount of processor time and memory, many runaway Minix process could affect the performance of the entire system.  If you suspect that you have some runaway Minix process, you should attempt to locate them and kill them immediately.  You can do this using the minix_cleanup command mentioned just a moment ago, or by using the ps –u $ur command to view all process owned by you.  Minix process will appear with the name ‘minix’ and usually appear in pairs of two.  You must kill both process to remove runaway Minix process.  Actually, if you kill the Minix process with the most ‘TIME’, it will kill both process and remove your lockfile for you.  After killing runaway Minix process, you may have to also remove your lockfile, located at ~/cop4600/lockfile.

本文发布于:2023-06-05 01:02:19,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/990235.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:总结   西安   工作   小吃街   学期
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图