http:^^osl.csc.ncsu.edu^departmental^labs^osl-lab.html
来自「This data set contains WWW-pages collect」· HTML 代码 · 共 620 行 · 第 1/2 页
HTML
620 行
>b EEPROM boot device...Boot: le(0,0,0) Using IP Address 152.1.58.32 = 98013A20 Booting from tftp server at 152.1.58.33 = 98013A21 Downloaded X bytes from tftp server.</PRE>Note: The X in the above line will be some number.<PRE> >g 4000</PRE>At this point Xinu will start and your program will begin execution.To return to hushpuppy press <Control-C>. This ends the odt session andcauses the connection between the front-end (hushpuppy) and a 3/60 to bebroken. Pressing <Control-C> does not cause the Xinu client to stop executing your program, it may continue executing after odt has been exited.<BR>B<PRE> <Control-C>Machine released sun4-%</PRE>If a target machine begins behaving strangely it may need to be reset. Toreset a 3/60, connect to it using the odt command as shown above. At the odt prompt enter k 2 (the letter k followed by a space and then the number2) and press <Return>. This will casue the client to reset, perform aself-test, then load any downloaded program into memory.<BR>Two switches (program options) commonly used with odt are -m and -h.<PRE> Switch Purpose -mMachine Name causes odt to connect the user terminal to Sun named Machine Name (an odt following a download will automatically use the same 3/60 selected by the download if the -m switch is not used) -h allows this 3/60 to remain reserved while another is also being used.</PRE> For example, odt -mfishstick -h will access fishstick and keep the reservationfor those computers which have already reserved. Normally, downloading and using odtto connect with one Xinu client releases any other reservations.<BR><a name="busers"><H4>busers: List the Xinu Client Users</H4> The command busers lists each of the 3/60s that is currently being reserved and the login name of the user who is using the target machine. Example:<BR><PRE> sun-4% busers fishstick idle time = 0 mins class = SUN reserved by ershanno frenchfry idly time = 2 mins class = SUN reserved by wjhicks</PRE><!WA14><a href="#table">Contents</a><hr><a name="develop"><H4>Program Development Example</H4> Any editor can be used to create source files. This sample program is compiled usingthe xcc command and download with the Xinu operating system to a Sun 3/60. The system callgetc is used to read characters form the terminal.<BR>C source program:<PRE> #include <conf.h> main () { char c; while ((c=getc(CONSOLE))!= 'A') printf("%c\n",c); } /* end of sample program */</PRE>The program is compiled using xcc.<PRE> sun-4%>xcc prog1.c prog1.c: a.out: 596+0 records in 37+1 records out sun-4%></PRE>The output file a.out is the absolute object image for the 3/60.<PRE> sun-4%> download a.out sun-4%>odt Using fishstick > b EEPROM boot device...Boot: le(0,0,0) Using IP Address 152.1.58.32 = 98013A20 Booting from tftp server at 152.1.58.33 = 98013A21 Downloaded 5432 bytes from tftp server. >g 4000</PRE> The program executes until the letter 'A' is typed. Press <Control-C> to releasethe target machine and return to hushpuppy. Remember, ending an odt session will not halt anyprograms that may be executing on a target machine.<BR><p><!WA15><a href="#table">Contents</a><hr><a name="xinu8"><H4>Working in Xinu 8</H4><H5>Adding Commands to Xinu 8 Shell</H5> <ul><li>Put command in {home}/xinu/src/sys/shell/usercmds. The home in this path is the directory where you originally uncompressed and untared the file. <li>In makefile in {home}/xinu/src/sys/shell add to the USEROFIL line so it will compile new command. The line should look something like this:<pre> USEROFIL = usercmds/ascdate.o usercmds/x_cat.o usercmds/x_cp.o \ usercmds/x_date.o usercmds/x_echo.o usercmds/x_mount.o \ usercmds/x_mv.o usercmds/x_rls.o usercmds/x_rm.o \ usercmds/x_sleep.o usercmds/x_unmou.o \ usercmds/x_close.o usercmds/x_kill.o \ usercmds/my_commands.o</pre><li>Run make in {home}/xinu/src/sys/shell/usercmds to make all the necessary object files <br>(See Using make in Xinu8 below).<li>In cmd.h add function name of command to list of externs. The externs listshould look like this after you have added my_command:<pre>extern int x_bpool(), x_cat(), x_close(), x_conf(), x_cp(), x_creat(), x_date(), x_devs(), x_dg(), x_echo(), x_exit(), x_help(), x_kill(), x_mem(), x_mount(), x_mv(), x_net(), x_ps(), x_reboot(), x_rf(), x_rls(), x_rm(), x_routes(), x_sleep(), x_snap(), x_unmou(), x_uptime(), x_who(), x_fmdump(), x_run(), x_pgstats(), x_printpgtbl(), x_vmem(), my_command();</pre><li>Add a line to #define CMDS so the shell knows what to run whenyou type a command in. The first piece of info is the command the shell willrecognize which should be in quotes followed by a comma. The second thing is a boolean variable that determines whether the command is builtin or not. Unsure of the implications of this with regards toxinu now so just set it to FALSE. The third thing is the name of thefunction that will be called when you type the command from the shellprompt. The CMDS line looks like this:<pre>#define CMDS "bpool", FALSE, x_bpool, \ "cat", FALSE, x_cat, \ "close", FALSE, x_close, \ "conf", FALSE, x_conf, \ "cp", FALSE, x_cp, \ "create", FALSE, x_creat, \ . . . "ruptime", FALSE, x_uptime, \ "sleep", FALSE, x_sleep, \ "snap", FALSE, x_snap, \ "time", FALSE, x_date, \ "unmount", FALSE, x_unmou, \ "uptime", FALSE, x_uptime, \ "who", FALSE, x_who, \ "vmem", FALSE, x_vmem, \ "?", FALSE, x_help \ "command", FALSE, my_command</pre></ul> Note: When adding commands to usercmds make sure the name of the function has the samename as the file. This is not absolutely necessary as long as the function to berun when a given command is typed in the shell corresponds with the function you think you are running. This link is setup in the cmd.h file.<br><br>The function should have the following structure:<br> <br><pre>COMMAND my_command(stdin, stdout, stderr, nargs, args) int stdin, stdout, stderr, nargs; char *args[];</pre><br> This function would be saved in a file called my_command.c<hr><h4> Using make in Xinu 8 </h4>Make needs to be run in your Xinu 8 directory to create the downloadable filewhich will be run on the Sun 3/60s. To do this there is a special script already written for this specific task. It is called <b>Makeall</b>. It should be located in the following directory: <br><br><pre>{home}/xinu/src/sys</pre>To execute it you will probably have to tell the shell where the script islocated since this directory is not in your path. If your are in the directory where Makeall is located the line to execute it would be:<br><br><pre>Sun-4%>./Makeall</pre><hr><h4>Getting a copy of Xinu 8</h4>To get a copy of Xinu 8 just click<!WA16><a href="ftp://ftp.csc.ncsu.edu/pub/Xinu/sun/xinu8.tar.Z">here</a><br><br>This will get a copy of the tared and compressed file. To untar and unzip the file, you will need to do the following<ul><li> Uncompress the file<pre>Sun-4%> uncompress xinu8.tar.Z</pre><li> Untar the file <pre>Sun-4%> tar xvf xinu8.tar</pre></ul><br><br>This will create three directories: docs, programs, and xinu. The source code is located in xinu and can be changed as described above.<hr><a name="trouble"><H4>Trouble Shooting in OSL</H4><H5>Trouble with xcc</H5> The command xcc creates temporary object files in your current directory whencompiling C programs and assembling 680xx programs. These temporary files have the same names as the source files except with a .o suffix. It is therefore not possible to compile twomodules with the same base name (name excluding the suffix) in the same directory such asread.c and read.s because the resulting object files will have the same name.<BR> <H5>Trouble with download</H5> If the hushpuppy responds to a download request with NO Suns Available you must waituntil someone releases a target machine as all are currently in use.<BR><H5>Trouble with odt</H5> If a 3/60 refuses to respond (at the point where you are expecting an odt prompt)press \ (backlash) then <Control-@> multiple times. If you see any prompt other than > whenyou start an odt session then another user's program is still running on the client. Use the samesame key sequence described above to abort the other program then boot normally.<BR> If a <Control-c> does not return you to hushpuppy, login to another terminal and killyour odt process (or ask an operator to do this for you).<BR> <H5>Stack Overflow</H5> The Suns in OSL are 32 bit machines and need twice as much memory to strore addressesand data as the 16 bit LSI 11 computers used in Volume 1 of Douglas Comer's book. There are example programs in the textbook that use the Xinu system call create to spawn newprocesses. You should double or triple the stack sizes given in the book for these programs tobe sure each process has enough memory. If a process runs out of stack space Xinu will replywith the error message Panic: current process stack overflow.<BR><H5>Report Problems with Lab Equipment</H5> If a problem persists with a particular machine, report it by sending mail to ops and use another 3/60. Mail sent to ops goes to all the operators and the first one to read your message willcorrect the problem.<BR><p><p><hr>For comments or sugestions about this document please send email to<br><p>Earl Shannon ershanno@hushpuppy.csc.ncsu.edu<br><p>Bill Hicks wjhicks@hushpuppy.csc.ncsu.edu<br>last-update: 1/29/96<br>version: 1.0</HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?