Course Information:
Lecture: | Tue Thu 11:00 - 12:15, on-line |
Required Materials: | Raspberry Pi v3 B+ -- info at the Raspberry Pi site
Arpaci-Dusseau & Arpaci-Dusseau, Operating Systems: Three Easy Pieces, available for free on-line or paid harcdopy |
Recommended Texts: | Kernighan & Ritchie. The C Programming Language (2nd Ed.), Prentice Hall
Sloss, Symes, and Wright. ARM System Developer's Guide, Elsevier baremetal_boot_code_for_ARMv8_A_processors.pdf (provides boot code for both 32-bit and 64-bit modes) |
Instructor Information:
Professor: | Bruce L. Jacob, Electrical & Computer Engineering |
Office: | 1333 A.V. Williams Building |
Phone: | (301) 405-0432 |
Email: | |
Office Hours: | None until the campus opens back up |
Section Info: | (note: all lab recitations held on-line) |
Sec. No. | TA Name | TA Email | Lab Day/Time |
0101 - | Arpit Bansal | arpitbansal297@gmail.com | Mon 12:00pm - 1:50pm |
0102 - | Taeyoung An | smilety@umd.edu | Mon 2:00pm - 3:50pm |
0103 - | Arpit Bansal | arpitbansal297@gmail.com | Wed 12:00pm - 1:50pm |
0104 - | Taeyoung An | smilety@umd.edu | Wed 2:00pm - 3:50pm |
Course Handouts, General Information, and some ARM documentation:
Additional Reading Material:
Running in 32-bit mode vs 64-bit mode
When you run 32-bit mode on the Raspberry Pi, you have to take out the line in the config.txt file that says the following:arm_control=0x200Also, make sure there is no kernel image called "kernel8.img" on your SD card, because the bootloader will search for the kernel with the largest number in its name (up to 8). Between kernel7 and kernel8, it will boot kernel8.
Cross-Compiler Information
This is fairly macOS-specific, since that is what I use (and, anyway, for Windows and Linux you can get pre-built installations). But hopefully it helps.You have to install binutils and gcc, and the order matters, depending on the install.
If you are running a Mac laptop, you will need to get Xcode installed. If you are running Mojave, you will also need to do the following at the command-line:
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target / [see https://apple.stackexchange.com/questions/337940/why-is-usr-include-missing-i-have-xcode-and-command-line-tools-installed-moja]This command creates and populates the /usr/include directory, which is the standard C-language directory that contains all system header files required for building anything. And, should you fail to run that rather obscure command on the command line, the /usr/include directory will otherwise not exist. Yes, I know exactly how stupid that sounds. Apple has gone WAYYYYYYY downhill since Steve Jobs died.
Also, I'm assuming that you have already done the other steps for macOS:
brew install gmp brew install mpfr brew install libmpcYou will have to make binutils to get the assembler, the linker/loader, and the objdump/objcopy executables. Go to the GNU website for that:
http://ftp.gnu.org/gnu/binutils/Grab the most recent version. Currently, it is "binutils-2.36.tar.xz" ...
For gcc, get the source code at
https://developer.arm.com/open-source/gnu-toolchain/gnu-a/downloadsCurrently this is the file "gcc-arm-src-snapshot-10.2-2020.11.tar.xz" at the bottom of the page, but as they create new versions they update the page, so just scroll to the bottom and get what's there.
The instructions for building binutils and gcc are provided below.
Note: the only difference between building a 32-bit cross-compiler and a 64-bit cross-compiler is that, for a 32-bit arch, you give the target as "arm-none-eabi" and for the 64-bit arch, you give the taret as "aarch64-elf" ... that part is very well done (thank you, GNU!).
Setting Up a 32-bit Cross-Compiler (arm-none-eabi)
Re: BINUTILS - Download it, untar it, etc. Outside of the binutils directory, create a directory called "build32" or whatever you want. Go to that directory and type the following:../binutils-2.36/configure --target=arm-none-eabi --disable-nls --enable-languages=c --without-headers make -j4 all make installRe: GCC - Download it, untar it, etc. Inside the main directory, create a subdirectory called "build32" or whatever you want. Go to that directory and type the following:
../gcc-arm-src-snapshot-10.2-2020.11/configure --target=arm-none-eabi --disable-nls --enable-languages=c --without-headers make -j4 all-gcc make install-gccYou will probably have to run the installs as root (sudo make install, sudo make install-gcc) so that the make processes can put the files into the /usr/local/bin space.
Let me know if you have issues.
Optional: Setting Up a 64-bit Cross-Compiler (aarch64-elf)
[This is just in case you are curious; we will be using 32-bit mode in this course, not 64-bit mode]
../binutils-2.36/configure --target=aarch64-elf --disable-nls --enable-languages=c --without-headers make -j4 all make installRe: GCC - Download it, untar it, etc. Inside the main directory, create a subdirectory called "build64" or whatever you want. Go to that directory and type the following:
../gcc-arm-src-snapshot-10.2-2020.11/configure --target=aarch64-elf --disable-nls --enable-languages=c --without-headers make -j4 all-gcc make install-gccYou will probably have to run the installs as root (sudo make install, sudo make install-gcc) so that the make processes can put the files into the /usr/local/bin space.
Let me know if you have issues.
Projects:
Project # | Due Date | Topic | Write-up | Code & Docs |
0 | Sun, Feb 7 | Get an RPi3 B+ board; get arm-none-eabi running; build a timer facility
Note: the project directory has .o files as well as a working kernel7.bin file, so that you can test your cross-compiler's output against mine, and also make sure that your RPi board runs correctly. | p0.pdf | p0/ Baremetal Programming ARM Quadcore-A7 doc: describes timers, mailboxes, etc. |
1 | Sun, Feb 14 | Get terminal I/O up and running
Note: the project directory has a working kernel7.bin file, so you can make sure that your RPi board w/ console cable runs correctly. | p1.pdf | p1/ Console Cable information |
2 | Sun, Feb 21 | Design & build a timeout queue facility | p2.pdf | p2/ |
3 | Sun, Mar 7 | Given interrupts, create a system-call facility w/ abstract devices
Note: The project directory gives you a working kernel that boots, starts up another binary ("app.bin"), which then calls a bunch of fake system calls. This is basically to show you how that the interrupt architecture works, as does the I/O software that reads the SD card. | p3.pdf | p3/ An example of multitasking, scheduling, syscalls, and abstract devices |
4 | Sun, Mar 28 | Preemptive context switching | p4.pdf | p4/ |
5 | Sun, Apr 18 | Multicore craziness and how to solve it | p5.pdf | p5/ |
6 | Sun, May 2 | Virtual memory | p6.pdf | p6/ |