2
0

Build.Tool 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. # This script is used to generate a bootable ISO image for A2
  2. #
  3. # Path: In this example, the destination path for the object files and all files generated (ZIP, ISO) is ../Test/.
  4. # This folder must exist. You can change it by search all occurences of "../Test/" and replace them by your preferred path..
  5. #
  6. # To create the CD image, do the following three steps:
  7. # Step 1: Compile modules and generate ZIP packages
  8. Release.Build --path="../Test/" --build --zip --xml Bios32 ~
  9. # Step 2: Link boot files
  10. System.DoCommands
  11. Linker.Link \P../Test/ \.Obx ../Test/IDE.Bin 0100000H 1000H Kernel Traps
  12. ATADisks DiskVolumes DiskFS Loader BootConsole ~
  13. ~
  14. # These boot images can't be built anymore because they get to large in terms of size
  15. Linker.Link \P../Test/ \.Obx ../Test/USB.Bin 0100000H 1000H Kernel Traps
  16. UsbHubDriver UsbEhci UsbStorageBoot
  17. DiskVolumes DiskFS Loader BootConsole ~
  18. Linker.Link \P../Test/ \.Obx ../Test/SCSI.Bin 0100000H 1000H Kernel Traps
  19. Adaptec7 NCR810Disks DiskVolumes DiskFS Loader BootConsole ~
  20. ~
  21. # Note:
  22. # Since USB.Bin gets too large when including all three host controller drivers,
  23. # USB.Bin only contains the host controller driver for high-speed USB (UsbEhci.Mod), assuming that the host supports it.
  24. # The low-/full-speed drivers (UsbUhci.Mod, UsbOhci.Mod) can be loaded later on-demand.
  25. # If you want to boot from a computer that does not support high-speed USB, use
  26. Linker.Link \P../Test/ \.Obx ../Test/USBSLOW.Bin 0100000H 1000H Kernel Traps
  27. UsbHubDriver UsbOhci UsbUhci UsbStorageBoot
  28. DiskVolumes DiskFS Loader BootConsole ~
  29. # Step 3a: Create image for bootable CD (A2.iso)
  30. System.DoCommands
  31. System.Timer start ~
  32. FSTools.Mount RAMDISK RamFS 2000000 4096 ~
  33. FSTools.DeleteFiles RAMDISK:A2.Dsk ~
  34. VirtualDisks.Create RAMDISK:A2.Dsk 320000 512 ~
  35. VirtualDisks.Install -c=80 -h=2 -s=18 -b=512 VDISK0 RAMDISK:A2.Dsk ~
  36. Linker.Link \P../Test/ \.Obx ../Test/CD.Bin 0100000H 1000H
  37. Kernel Traps ATADisks DiskVolumes RAMVolumes DiskFS Loader BootConsole ~
  38. Partitions.Format VDISK0#0 AosFS 1024 ../Test/CD.Bin ~
  39. FSTools.Mount TEMP AosFS VDISK0#0 ~
  40. ZipTool.Delete ../Test/Applications.zip InstallerPackages.XML ~
  41. ZipTool.Add --nopath ../Test/Applications.zip ../Test/InstallerPackages.XML ~
  42. ZipTool.ExtractAll --prefix=TEMP: --sourcePath=../Test/ --overwrite --silent
  43. Kernel.zip System.zip Drivers.zip ApplicationsMini.zip Applications.zip Compiler.zip CompilerSrc.zip
  44. GuiApplicationsMini.zip GuiApplications.zip Fun.zip Contributions.zip Build.zip EFI.zip
  45. Oberon.zip OberonGadgets.zip OberonApplications.zip OberonDocumentation.zip
  46. KernelSrc.zip SystemSrc.zip DriversSrc.zip ApplicationsMiniSrc.zip ApplicationsSrc.zip GuiApplicationsMiniSrc.zip GuiApplicationsSrc.zip FunSrc.zip BuildSrc.zip
  47. ScreenFonts.zip CjkFonts.zip TrueTypeFonts.zip ~
  48. System.Show Copy ZIP archives to TEMP: ~
  49. FSTools.CopyTo TEMP: ../Test/
  50. Kernel.zip System.zip Drivers.zip ApplicationsMini.zip Applications.zip Compiler.zip
  51. GuiApplicationsMini.zip GuiApplications.zip
  52. Fun.zip Testing.zip Build.zip EFI.zip Contributions.zip
  53. KernelSrc.zip SystemSrc.zip DriversSrc.zip ApplicationsMiniSrc.zip ApplicationsSrc.zip CompilerSrc.zip
  54. GuiApplicationsMiniSrc.zip GuiApplicationsSrc.zip
  55. FunSrc.zip TestingSrc.zip BuildSrc.zip EFISrc.zip ContributionsSrc.zip
  56. Education.zip EducationSrc.zip
  57. Oberon.zip OberonGadgets.zip OberonApplications.zip OberonDocumentation.zip
  58. ScreenFonts.zip TrueTypeFonts.zip CjkFonts.zip
  59. OberonSrc.zip OberonApplicationsSrc.zip OberonGadgetsSrc.zip
  60. OberonVoyager.zip OberonVoyagerSrc.zip OberonAnts.zip OberonAntsSrc.zip
  61. Pr3Fonts.zip Pr6Fonts.zip
  62. IDE.Bin CompileCommand.Tool ~
  63. FSTools.Watch TEMP ~
  64. FSTools.Unmount TEMP ~
  65. Partitions.SetConfig VDISK0#0
  66. TraceMode="0" TracePort="1" TraceBPS="19200" TraceMem="0B8000H,2,80,25"
  67. BootVol1="RAM RamFS 8000 4096"
  68. BootVol2="CD AosFS #0,R"
  69. RamFS="RAMVolumes.New DiskFS.NewFS"
  70. AosFS="DiskVolumes.New DiskFS.NewFS"
  71. Boot1="Keyboard.Install;MousePS2.Install"
  72. Boot2="DriverDatabase.Enable;UsbHubDriver.Install;UsbEhciPCI.Install;UsbUhci.Install;UsbOhci.Install"
  73. Boot3="WindowManager.Install"
  74. Boot4="Loopback.Install;Ethernet3Com90x.Install;RTL8139.Install;Intel8255x.Install;AM79C970.Install"
  75. Boot5="Autostart.Run"
  76. Boot6="InitNetwork.Init"
  77. Boot="DisplayLinear.Install"
  78. Init="117"
  79. CacheSize="1000"
  80. AutoNetConfig="1"
  81. ATAPIForcePIO="1"
  82. ~
  83. VirtualDisks.Uninstall VDISK0 ~
  84. IsoImages.Make ../Test/A2.iso RAMDISK:A2.Dsk ~
  85. FSTools.Unmount RAMDISK ~
  86. System.Show CD image build time: ~ System.Timer elapsed ~
  87. ~~
  88. # Step 3b: Create image for bootable CD (A2mini.iso)
  89. System.DoCommands
  90. System.Timer start ~
  91. FSTools.Mount RAMDISK RamFS 2000000 4096 ~
  92. FSTools.DeleteFiles RAMDISK:A2.Dsk ~
  93. VirtualDisks.Create RAMDISK:A2.Dsk 80000 512 ~
  94. VirtualDisks.Install -c=80 -h=2 -s=18 -b=512 VDISK0 RAMDISK:A2.Dsk ~
  95. Linker.Link \P../Test/ \.Obx ../Test/CD.Bin 0100000H 1000H
  96. Kernel Traps ATADisks DiskVolumes RAMVolumes DiskFS Loader BootConsole ~
  97. Partitions.Format VDISK0#0 AosFS 1024 ../Test/CD.Bin ~
  98. FSTools.Mount TEMP AosFS VDISK0#0 ~
  99. ZipTool.Delete ../Test/Applications.zip InstallerPackages.XML ~
  100. ZipTool.Add --nopath ../Test/Applications.zip ../Test/InstallerPackages.XML ~
  101. ZipTool.ExtractAll --prefix=TEMP: --sourcePath=../Test/ --overwrite --silent
  102. Kernel.zip System.zip Drivers.zip ApplicationsMini.zip Compiler.zip GuiApplicationsMini.zip Build.zip
  103. KernelSrc.zip SystemSrc.zip DriversSrc.zip ApplicationsMiniSrc.zip CompilerSrc.zip GuiApplicationsMiniSrc.zip BuildSrc.zip
  104. ScreenFonts.zip ~
  105. FSTools.Watch TEMP ~
  106. FSTools.Unmount TEMP ~
  107. Partitions.SetConfig VDISK0#0
  108. TraceMode="0" TracePort="1" TraceBPS="19200" TraceMem="0B8000H,2,80,25"
  109. BootVol1="RAM RamFS 8000 4096"
  110. BootVol2="CD AosFS #0,R"
  111. RamFS="RAMVolumes.New DiskFS.NewFS"
  112. AosFS="DiskVolumes.New DiskFS.NewFS"
  113. Boot1="Keyboard.Install;MousePS2.Install"
  114. Boot2="DriverDatabase.Enable;UsbHubDriver.Install;UsbEhciPCI.Install;UsbUhci.Install;UsbOhci.Install"
  115. Boot3="WindowManager.Install"
  116. Boot5="Autostart.Run"
  117. Boot="DisplayLinear.Install"
  118. Init="117"
  119. CacheSize="1000"
  120. AutoNetConfig="1"
  121. ATAPIForcePIO="1"
  122. ~
  123. VirtualDisks.Uninstall VDISK0 ~
  124. IsoImages.Make ../Test/A2mini.iso RAMDISK:A2.Dsk ~
  125. FSTools.Unmount RAMDISK ~
  126. System.Show CD image build time: ~ System.Timer elapsed ~
  127. ~~
  128. # Step 3c: Create image for bootable H.D.D. (A2HDD.img), should work with bochs, at least.
  129. System.DoCommands
  130. PCAAMD64.Assemble OBLUnreal.Asm ~
  131. PartitionsLib.SetBootLoaderFile OBLUnreal.Bin ~
  132. System.Timer start ~
  133. FSTools.DeleteFiles ../Test/A2HDD.img ~
  134. VirtualDisks.Create ../Test/A2HDD.img 65520 512 ~
  135. VirtualDisks.Install -b=512 VDISK0 ../Test/A2HDD.img ~
  136. Linker.Link \P../Test/ \.Obx ../Test/IDE.Bin 0100000H 100000H Kernel Traps
  137. ATADisks DiskVolumes DiskFS Loader BootConsole ~
  138. Partitions.WriteMBR VDISK0#0 OBEMBR.Bin ~
  139. Partitions.InstallBootManager VDISK0#0 ~
  140. Partitions.Create VDISK0#1 76 32 ~
  141. Partitions.Format VDISK0#1 AosFS 512 ../Test/IDE.Bin ~
  142. FSTools.Mount TEMP AosFS VDISK0#1 ~
  143. ZipTool.ExtractAll --prefix=TEMP: --sourcePath=../Test/ --overwrite --silent
  144. System.zip Drivers.zip ApplicationsMini.zip ApplicationsMiniSrc.zip Compiler.zip GuiApplicationsMini.zip
  145. ScreenFonts.zip ~
  146. FSTools.Watch TEMP ~
  147. FSTools.Unmount TEMP ~
  148. Partitions.SetConfig VDISK0#1
  149. TraceMode="5" TracePort="1" TraceBPS="115200"
  150. BootVol1="AOS AosFS IDE0#1"
  151. Boot="DisplayLinear.Install"
  152. AosFS="DiskVolumes.New DiskFS.NewFS"
  153. Boot1="Keyboard.Install;MousePS2.Install"
  154. Boot2="DriverDatabase.Enable;UsbHubDriver.Install;UsbEhciPCI.Install;UsbUhci.Install;UsbOhci.Install"
  155. Boot3="WindowManager.Install"
  156. Boot5="Autostart.Run"
  157. Init="144"
  158. CacheSize="1000"
  159. ExtMemSize="64"
  160. MaxProcs="-1"
  161. ~
  162. VirtualDisks.Uninstall VDISK0 ~
  163. System.Show HDD image build time: ~ System.Timer elapsed ~
  164. FSTools.CloseFiles ../Test/A2HDD.img ~
  165. ~~
  166. # Step 3d: Create image for bootable H.D.D. (A2HDD.img) for VirtualBox
  167. System.DoCommands
  168. System.Timer start ~
  169. FSTools.DeleteFiles ../Test/A2HDD.img ~
  170. VirtualDisks.Create ../Test/A2HDD.img 320000 512 ~
  171. VirtualDisks.Install -b=512 VDISK0 ../Test/A2HDD.img ~
  172. Linker.Link \P../Test/ \.Obx ../Test/IDE.Bin 0100000H 1000H Kernel Traps
  173. ATADisks DiskVolumes DiskFS Loader BootConsole ~
  174. Partitions.WriteMBR VDISK0#0 OBEMBR.Bin ~
  175. Partitions.InstallBootManager VDISK0#0 ~
  176. Partitions.Create VDISK0#1 76 32 ~
  177. Partitions.Format VDISK0#1 AosFS 512 ../Test/IDE.Bin ~
  178. FSTools.Mount TEMP AosFS VDISK0#1 ~
  179. ZipTool.ExtractAll --prefix=TEMP: --sourcePath=../Test/ --overwrite --silent
  180. Kernel.zip System.zip Drivers.zip ApplicationsMini.zip Applications.zip Compiler.zip CompilerSrc.zip
  181. GuiApplicationsMini.zip GuiApplications.zip Fun.zip Contributions.zip Build.zip EFI.zip
  182. Oberon.zip OberonGadgets.zip OberonApplications.zip OberonDocumentation.zip
  183. KernelSrc.zip SystemSrc.zip DriversSrc.zip ApplicationsMiniSrc.zip ApplicationsSrc.zip GuiApplicationsMiniSrc.zip GuiApplicationsSrc.zip FunSrc.zip BuildSrc.zip
  184. ScreenFonts.zip CjkFonts.zip TrueTypeFonts.zip ~
  185. FSTools.Watch TEMP ~
  186. FSTools.Unmount TEMP ~
  187. Partitions.SetConfig VDISK0#1
  188. TraceMode="0" TracePort="1" TraceBPS="115200"
  189. BootVol1="AOS AosFS IDE0#1"
  190. AosFS="DiskVolumes.New DiskFS.NewFS"
  191. Boot1="Keyboard.Install;MousePS2.Install"
  192. Boot2="DriverDatabase.Enable;UsbHubDriver.Install;UsbEhciPCI.Install;UsbUhci.Install;UsbOhci.Install"
  193. Boot3="WindowManager.Install"
  194. Boot5="Autostart.Run"
  195. Boot="DisplayLinear.Install"
  196. Init="144"
  197. ATADetect="legacy"
  198. ExtMemSize="256"
  199. CacheSize="1000"
  200. ~
  201. VirtualDisks.Uninstall VDISK0 ~
  202. System.Show HDD image build time: ~ System.Timer elapsed ~
  203. ~~
  204. ../Test/CompileCommand.Tool
  205. ***********************************************************************
  206. # Step 1: Compile modules and generate ZIP packages
  207. Release.Build --path="../Test/" --build --zip --xml Bios32 ~
  208. # Step 3e: Create image for bootable USB (A2USB.img)
  209. System.DoCommands
  210. Compiler.Compile -b=AMD --bits=32 --objectFileExtension=.Obx --symbolFileExtension=.Obx --destPath=../Test/ BIOS.PCI.Mod UsbEhci.Mod UsbEhciPCI.Mod ~
  211. PCAAMD64.Assemble OBLUnreal.Asm ~
  212. PartitionsLib.SetBootLoaderFile OBLUnreal.Bin ~
  213. PCAAMD64.Assemble BootManager.Asm ~
  214. BootManager.Split BootManager.Bin ~
  215. System.Timer start ~
  216. FSTools.DeleteFiles ../Test/A2HDD.img ~
  217. VirtualDisks.Create ../Test/A2HDD.img 320000 512 ~
  218. VirtualDisks.Install -b=512 VDISK0 ../Test/A2HDD.img ~
  219. Linker.Link \P../Test/ \.Obx ../Test/USB.Bin 0100000H 100000H Kernel Traps
  220. UsbHubDriver UsbEhci UsbEhciPCI UsbStorageBoot
  221. DiskVolumes DiskFS Loader BootConsole ~
  222. Partitions.WriteMBR VDISK0#0 OBEMBR.Bin ~
  223. Partitions.InstallBootManager VDISK0#0 BootManagerMBR.Bin BootManagerTail.Bin ~
  224. Partitions.Create VDISK0#1 76 150 ~
  225. Partitions.Format VDISK0#1 AosFS -1 ../Test/USB.Bin ~ (* -1 makes sure that actual boot file size is taken as offset for AosFS *)
  226. FSTools.Mount TEMP AosFS VDISK0#1 ~
  227. ZipTool.ExtractAll --prefix=TEMP: --sourcePath=../Test/ --overwrite --silent
  228. Kernel.zip System.zip Drivers.zip ApplicationsMini.zip Applications.zip Compiler.zip CompilerSrc.zip
  229. GuiApplicationsMini.zip GuiApplications.zip Fun.zip Contributions.zip Build.zip EFI.zip
  230. Oberon.zip OberonGadgets.zip OberonApplications.zip OberonDocumentation.zip
  231. KernelSrc.zip SystemSrc.zip DriversSrc.zip ApplicationsMiniSrc.zip ApplicationsSrc.zip GuiApplicationsMiniSrc.zip GuiApplicationsSrc.zip FunSrc.zip BuildSrc.zip
  232. ScreenFonts.zip CjkFonts.zip TrueTypeFonts.zip ~
  233. FSTools.Watch TEMP ~
  234. FSTools.Unmount TEMP ~
  235. Partitions.SetConfig VDISK0#1
  236. TraceMode="1"
  237. TracePort="1"
  238. TraceBPS="115200"
  239. BootVol1="AOS AosFS USB0#1"
  240. AosFS="DiskVolumes.New DiskFS.NewFS"
  241. CacheSize="1000"
  242. ExtMemSize="512"
  243. MaxProcs="-1"
  244. ATADetect="legacy"
  245. Init="118"
  246. Boot="DisplayLinear.Install"
  247. Boot1="Keyboard.Install;MousePS2.Install"
  248. Boot2="DriverDatabase.Enable;UsbHubDriver.Install;UsbEhciPCI.Install;UsbUhci.Install;UsbOhci.Install"
  249. Boot3="WindowManager.Install"
  250. Boot4="Autostart.Run"
  251. ~
  252. VirtualDisks.Uninstall VDISK0 ~
  253. System.Show HDD image build time: ~ System.Timer elapsed ~
  254. FSTools.CloseFiles ../Test/A2HDD.img ~
  255. ~
  256. use this to test machine with autoreboot
  257. Boot5="Reboot.Do 10000 reboot"
  258. WinDisks.Install E: RW ~
  259. ~
  260. *** CAUTION: check that drive is not a local drive !!!! ***
  261. System.DoCommands
  262. Partitions.FileToPartition PhysicalDrive1#0 ../Test/A2HDD.img 0 160000 ~
  263. WinDisks.Uninstall "PhysicalDrive1" ~
  264. ~