The following assumes that your shell is bash. The syntax may vary slightly if you use a different shell. (Run "echo $0" to determine your current shell.)
Setting environment variables for XINU:
1. Edit .bashrc in your home directory by adding /p/xinu/bin to your path:
2. Run source .bashrc (or its equivalent) to make the change take effect.
Accessing and untarring XINU tarball source files:
tar zxvf /homes/cs354/xinu-fall2020.tar.gz
In your home directory, you will now have a directory called xinu-fall2020. The subdirectories under this directory contain source code, header files, configuration files, and Makefile for compiling XINU.
% cd xinu-fall2020/compile % make clean % makeThis creates a loadable executable file named xinu.xbin. This file is loaded on a backend machine in Section 3 ('Running XINU').
If, upon loading xinu.xbin and power cycling to run XINU the system hangs, repeat 'make clean' followed by make. When adding new source files to XINU, run 'make rebuild' followed by make to incorporate changes. If XINU hangs or crashes after following the above steps, the cause is likely to be bugs in your code modifications. To avoid starting from scratch, maintain working versions that you can return to.
The backends are all Intel Galileo development boards which run the quark system on chip processor.
The backend machines are shared resources. When a backend machine is grabbed by a student, it is dedicated for use by that student to run his/her version of XINU. To see which backends are available for booting XINU, type:
% cs-status -c quarkThis will show you who is using each backend and how long they have been using it. As with all hardware, sometimes they fail and may become unavailable until repaired by our technical staff.
To boot your copy of XINU on a backend, connect to a back-end by issuing the command:
% cs-console [galileo1__]With no arguments cs-console will connect you to the first available backend (including broken ones). Occasionally, backend hardware malfunctions. If you suspect this to be the case, please inform the TAs.
To load your copy of XINU onto a selected backend:
(control-@) OR (control-spacebar) //esc to local command-mode (command-mode) d //download command file: xinu.xbin //tell it to download 'xinu.xbin' (this example assumes that you are in the xinu-fall2020/compile directory) (control-@) OR (control-spacebar) //esc to local command-mode (command-mode) p //power cycle the backendAfter several seconds XINU should boot with a "Welcome to Xinu!" message that looks something like this:
Xinu for galileo -- version #10 (park) Wed Aug 19 15:34:30 EDT 2020 Ethernet Link is Up MAC address is 98:4f:ee:00:0a:cf 250076704 bytes of free memory. Free list: [0x0015C1E0 to 0x0EFD8FFF] [0x0FDEF000 to 0x0FDEFFFF] 111249 bytes of Xinu code. [0x00100000 to 0x0011B290] 135848 bytes of data. [0x0011F020 to 0x001402C7] Hello World! I'm the first XINU app and running function main() in system/main.c. I was created by nulluser() in system/initialize.c using create(). My creator will turn itself into the do-nothing null process. I will create a second XINU app that runs shell() in shell/shell.c as an example. You can do something else, or do nothing; it's completely up to you. ...creating a shell ------------------------------------------ __ __ _____ _ _ _ _ \ \ / / |__ __| | \ | | | | | | \ \/ / | | | \| | | | | | / /\ \ _| |_ | \ | | | | | / / \ \ | | | | \ | \ -- / -- -- ----- - - ---- ------------------------------------------ Welcome to Xinu! xsh $
To disconnect and free up the backend:
(control-@) OR (control-spacebar) (command-mode) p //power cycle the backend; wait until you see "Press [Enter] ..." (control-@) OR (control-spacebar) (command-mode) q //quit
Please do not leave a running
copy of your XINU on a backend. This will prevent others from using that
You can remote access the frontend lab PCs using TLS/SSL applications such as ssh on Linux/MacOS and PuTTY (or OpenSSH) on Windows. Use of the backends is limited to implementing, testing, and evaluating lab assignments of CS 354. You access the backends through one of the frontend machines in the XINU Lab.
By default, when XINU boots up, it runs a shell (xsh). To view all the usable shell commands, run the help command:
xsh $ help shell commands are: argecho date help netinfo udp ? arp devdump kill ping udpecho cat echo memdump ps udpeserver clear exit memstat sleep uptime
Take a moment to run some shell commands and view their output. Specifically make sure you run the ps command which lists information about running processes.
xsh $ ps Pid Name State Prio Ppid Stack Base Stack Ptr Stack Size --- ---------------- ----- ---- ---- ---------- ---------- ---------- 0 prnull ready 0 0 0x0EFDEFFC 0x0EFDEEC0 8192 1 rdsproc wait 200 0 0x0EFDCFFC 0x0EFDCAAC 16384 2 Main process recv 20 2 0x0EFD8FFC 0x0EFD8F64 65536 3 shell recv 50 3 0x0EFC8FFC 0x0EFC8C6C 8192 4 ps curr 20 4 0x0EFC6FFC 0x0EFC6E18 8192
Here you can see the several pieces of information for all processes currently running. The name gives some detail about what the process is intended for. XINU always contains a special process with process identifier (pid) 0 called the null process (or prnull). This process is the first process created by XINU and is always ready to execute. Unlike other processes, prnull is handcrafted without using create(). The inclusion of this process ensures that there is always something for XINU to execute even if all other processes have finished or are waiting for something. By default, UNIX/Linux and Windows have similar null or idle processes.