Back to home page

Quest Cross Reference

 
 

    


0001 CONFIGURATION:
0002 ~~~~~~~~~~~~~~
0003 
0004 $ make config.mk
0005 # Edit config.mk and make desired changes
0006 
0007 COMPILE AND INSTALL:
0008 ~~~~~~~~~~~~~~~~~~~~
0009 
0010 # First, compile libc
0011 $ make -C ../libc
0012 
0013 # Then choose one of the following methods:
0014 
0015 Compile onto a Hard Drive image:
0016 --------------------------------
0017 
0018   # Make a mount point
0019   $ sudo mkdir /mnt/quest
0020 
0021   # Mount the disk image:
0022   $ sudo mount -t ext2 -o loop,offset=32256 c.img /mnt/quest
0023 
0024   # Clean, compile, and install into the disk image:
0025   $ make clean quest && sudo make install
0026 
0027 Or, compile onto a CD-ROM image:
0028 --------------------------------
0029 
0030   # Requires the program 'mkisofs'
0031   $ make clean quest.iso
0032 
0033 Or, compile for netboot:
0034 ------------------------
0035 
0036   # Build and install into tftp/
0037   $ make clean netboot
0038 
0039 Using the emulators:
0040 --------------------
0041 
0042   # Run QEMU with GDB-stub support
0043   $ qemu -s -smp 4 c.img
0044 
0045   # Or, CD-ROM image
0046   $ qemu -s -smp 4 -cdrom quest.iso
0047 
0048   # Run BOCHS
0049   $ bochs -q -f bochsrc-smp
0050 
0051   # Or, CD-ROM image
0052   $ bochs -q -f bochsrc-cdrom
0053 
0054   # Netboot
0055   $ qemu -boot n \
0056          -net nic,model=pcnet \
0057          -net user,tftp=tftp,bootfile=grub2pxe \
0058          -cdrom quest.iso
0059   #   the options above have the following meanings:
0060   #   -boot n                 Boot from Network PXE ROM
0061   #   -net nic,model=pcnet    Emulate a PCnet network card
0062   #   -net user,...           QEMU sets up a firewall with TFTP and DHCP
0063   #   -cdrom quest.iso        Just to have a file-system with programs...
0064 
0065   # QEMU with TCP serial-port for GDB-stub
0066   $ qemu -cdrom quest.iso -serial tcp::1234,server
0067 
0068 INSIDE QUESTOS:
0069 ~~~~~~~~~~~~~~~
0070 
0071 # Play Pacman! (probably broken)
0072 > /boot/mame
0073 
0074 # Testing fork/exec and SMP:
0075 > /boot/test1
0076 ...
0077 > /boot/test6
0078 
0079 # Backspace doesn't work.  Sorry.
0080 
0081 USING GDB-STUB SUPPORT
0082 ~~~~~~~~~~~~~~~~~~~~~~
0083 
0084 If you are using QEMU or BOCHS with GDB-stub support then you can run gdb and
0085 invoke commands
0086 
0087 (gdb) file quest
0088 (gdb) target remote localhost:1234
0089 
0090 where localhost:1234 is the default listening port of GDB-stub.  If you put
0091 these commands in a file .gdbinit in the current directory then gdb will run
0092 these commands automatically when it starts.
0093 
0094 Currently, BOCHS does not support GDB-stub AND SMP at the same time.  It has an
0095 internal debugger that can be enabled with SMP however.  There is an
0096 undocumented command: "set $cpu <n>" which allows you to switch processors in
0097 the BOCHS debugger.
0098 
0099 Examining gdb-stub packets: 
0100   sudo tcpdump -s 256 -i lo 'tcp port 1234 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' -w tcp.dump
0101   sudo tcpdump -X -r tcp.dump|less
0102