Course Information:
Lecture: | Tue Thu 11:00 - 12:15, EGR-1108 |
Mailing List: | enee447-01all-spr19@coursemail.umd.edu |
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 harcopy |
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: | Open-door policy ... |
Section Info: | (note: all lab recitations held in AVW-1442) |
Sec. No. | TA Name | TA Email | Lab Day/Time |
0101 - | Tauqir Abdullah | tauqir.abdullah@gmail.com | Mon 12:00pm - 1:50pm |
0102 - | Dylan O'Reagan | oreagandylan@gmail.com | Mon 2:00pm - 3:50pm |
0103 - | Tauqir Abdullah | tauqir.abdullah@gmail.com | Wed 12:00pm - 1:50pm |
0104 - | Dylan O'Reagan | oreagandylan@gmail.com | 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.32.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-8.2-2019.01.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.32/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-8.2-2019.01/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.
Setting Up a 64-bit Cross-Compiler (aarch64-elf)
Re: BINUTILS - Download it, untar it, etc. Outside of the binutils directory, create a directory called "build64" or whatever you want. Go to that directory and type the following:../binutils-2.32/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-8.2-2019.01/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 aarch32-elf running; build a timer facility
Note: the project directory has .o files as well as a working kernel8.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 kernel8.bin file, so you can make sure that your RPi board w/ console cable runs correctly. | p1.pdf | p1/ Console Cable information |