CS 630 PROJECT #2 Due Date: Noon Tuesday 04/06/2004 This project explores essential steps in crafting minimal operating system code that can load and execute the object-code within an ELF file that was compiled for Linux, running in protected-mode on a Pentium CPU. PROBLEM DESCRIPTION Design a miniature operating system (named 'os630.s') which can run the 'manydots.s' demo-program (found on our course website) at privilege level 3 in protected mode. You will need to implement your own handlers for the timer-tick and keyboard interrupts, and for Linux's system-calls (invoked via the 'int 0x80' software interrupt instruction). You should reprogram the 8259A Interrupt Controllers to issue the device-interrupts in a manner that avoids conflicts with Intel reserved interrupt-numbers. Your operating system should continuously show the time-of-day onscreen, using a status-line separate from the normal console-output screen area. Download the demo-program named 'manydots.s' from our class website and assemble it using the GNU/Linux assembler 'as' to produce a linkable ELF-file (named 'manydots.o'), like this: $ as manydots.s -o manydots.o Then use the 'dd' utility to install the 'manydots.o' ELF-file onto your floppy diskette, starting from sector #14 of track 0, like this: $ dd if=manydots.o of=/dev/fd0 seek=13 This insures that the ELF-file's contents will get loaded into memory as you 'boot' from this diskette, assuming our 'trackldr.b' boot-loader was installed in the 'boot-sector' as usual, like this: $ dd if=trackldr.b of=/dev/fd0 The final step, in preparing your diskette for submission, is to install your operating system binary (i.e., 'os630.b') on the diskette following the boot-sector, like this: $ dd if=os630.b of=/dev/fd0 seek=1 It is vital that the filesize of your 'os630.b' binary should not exceed six kilobytes (i.e., twelve diskette sectors), to avoid overwriting your ELF-file's image which begins in sector #14, as shown below: SECTOR-MAP FOR DISKETTE TRACK 0 sector #1 sectors #2-#13 sectors #14-#18 +-------------+-------------------+----------------------+ | boot-loader | <--- os630.b ---> | <--- manydots.o ---> | +-------------+-------------------+----------------------+ Place the assembly language source-text into your '/submit' folder, along with your binary output-file produced by the 'as86' assembler, and put your diskette and source-text printout in the Instructor's mailbox. ________________________________________________________________________ Allan B. Cruse University of San Francisco Spring 2004