SYSLINUX 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. qemu-img create -f qcow2 harvey.qcow2 3G
  2. sudo modprobe nbd max_part=63
  3. sudo qemu-nbd -c /dev/nbd0 harvey.qcow2
  4. sudo dd conv=notrunc bs=440 count=1 if=/usr/lib/syslinux/mbr/mbr.bin of=/dev/nbd0
  5. sudo fdisk /dev/nbd0
  6. [Don't forget making bootable the partition you created!]
  7. sudo mkfs.ext4 /dev/nbd0p1
  8. sudo mount /dev/nbd0p1 disk/
  9. sudo extlinux -i disk/
  10. sudo cp ../sys/src/9/amd64/harvey.32bit disk/harvey
  11. cd disk/
  12. sudo mkdir syslinux
  13. $ ls -l
  14. total 5964
  15. -rwxr-xr-x 1 root root 5884264 jun 8 02:16 harvey
  16. -r--r--r-- 1 root root 116624 jun 7 02:12 ldlinux.c32
  17. -r--r--r-- 1 root root 61440 jun 7 02:12 ldlinux.sys
  18. drwx------ 2 root root 16384 jun 7 02:10 lost+found
  19. drwxr-xr-x 2 root root 4096 jun 8 02:25 syslinux
  20. $ ls -l syslinux/
  21. total 280
  22. -rw-r--r-- 1 root root 182552 jun 7 02:34 libcom32.c32
  23. -rw-r--r-- 1 root root 23480 jun 7 02:34 libutil.c32
  24. -rw-r--r-- 1 root root 10172 jun 8 01:29 mboot.c32
  25. -rw-r--r-- 1 root root 25668 jun 7 02:34 menu.c32
  26. -rw-r--r-- 1 root root 727 jun 8 02:05 syslinux.cfg
  27. -rw-r--r-- 1 root root 26188 jun 7 02:25 vesamenu.c32
  28. [modules are into /usr/lib/syslinux/modules/bios/ so copy it from there]
  29. $ cat syslinux/syslinux.cfg
  30. # syslinux.cfg
  31. #TIMEOUT = Time to wait to autoboot in 1/10 secs. zero (0) disables the timeout
  32. #PROMPT = one (1) displays the prompt only, zero (0) will not display the prompt
  33. #ONTIMEOUT = The default menu label to automatically boot at timeout (selected after timeout)
  34. #DISPLAY = Optional menu text if not using LABEL Entries
  35. TIMEOUT 1000
  36. DEFAULT vesamenu.c32
  37. #MENU BACKGROUND /backgroundimages/your_image_here.png
  38. MENU TITLE Harvey OS
  39. PROMPT 0
  40. ONTIMEOUT 1
  41. #DISPLAY Menu.txt
  42. #Display help text when F1 pressed on Syslinux Menu
  43. F1 help.txt
  44. LABEL 0
  45. MENU LABEL Reboot
  46. TEXT HELP
  47. Restart the computer
  48. ENDTEXT
  49. COM32 reboot.c32
  50. LABEL 1
  51. TEXT HELP
  52. Boot Harvey kernel
  53. ENDTEXT
  54. MENU LABEL Harvey OS
  55. KERNEL mboot.c32
  56. APPEND ../harvey
  57. sudo umount disk/
  58. sudo qemu-nbd -d /dev/nbd0
  59. [Run qemu]
  60. qemu-system-x86_64 --enable-kvm -s -cpu core2duo -smp 2 -m 2048 -monitor stdio -serial /dev/pts/4 --machine pc -net nic,model=rtl8139 -net user,hostfwd=tcp::5555-:23 -drive file=/media/backup1/source/plan9/harvey/util/harvey.qcow2,media=disk,index=0,cache=writeback