git @ Cat's Eye Technologies Funicular / 84f585e
initdist command, and rip stuff from FreeDOS Gondola, broken. Chris Pressey 10 years ago
8 changed file(s) with 189 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
22 system_image = 'hda.img',
33 work_image = 'fda.img',
44 setup_image = 'freedos-init-cd.iso',
5 dist_image = 'a.img',
56 distfiles = [[
67 http://www.mirrorservice.org/sites/ftp.delorie.com/pub/djgpp/current/v2/copying.dj
78 http://www.mirrorservice.org/sites/ftp.delorie.com/pub/djgpp/current/v2/djdev203.zip
6061 * THEN HIT ENTER AGAIN. It's waiting silently for you.
6162 * When finished, you can just stop the emulator.
6263 ]],
64
65 dist_instructions = [[
66 Phase 2
67 -------
68
69 Create a floppy image (360K, 720K, or 1.44M) for use in v86 or elsewhere.
70 Obviously, this is not big enough for most dev tools, but we can squeeze
71 a few in.
72
73 * Back on the host, run `./create-fda-image.sh` to make a floppy image
74 (enter either `0.36`, `0.72`, or `1.44` for size)
75
76 * Run `./start-freedos.sh`
77
78 * run `D:\INITFLOP`.
79 * enter `360`, `720`, or `1440` as appropriate.
80 * select to install `yasm` or not, as you desire. (requires 720!)
81 * select to install `perl` or not, as you desire. (requires 1440!)
82 * When finished, quit QEMU.
83
84 * Run `./start-freedos.sh floppy` to confirm that the floppy image boots.
85 Then just quit QEMU.
86
87 We now have a bootable floppy image with a few basic tools on it. We can
88 "outfit" it with something more interesting. And while we could do this
89 from the guest FreeDOS instance, parts of it are easier to do from the host,
90 using `mtools`.
91
92 ### Shelta ###
93
94 * Create a 720K floppy, as described above. Elect to install `yasm` on it.
95
96 * Back on the host, run `toolshelf dock bb:catseye/shelta` if you haven't
97 got it.
98
99 * Run `./outfit-floppy-shelta.sh`
100
101 * Run `./start-freedos.sh floppy` to confirm that the floppy image boots.
102 And test `shelta` on it. Then just quit QEMU.
103
104 ]],
63105 }
64106
65107 --[[
71113
72114 # http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.0/fdboot.img
73115 #FREEDOS_BOOT_FLOPPY=$IMGDIR/fdboot.img
116
117 Please type 0.16, 0.18, 0.32, 0.36, 0.72, 1.2, 1.44, 1.68, 1.72, or 2.88.
118
119 160 * 1024
120 180
121 320
122 360
123 720
124 1200
125 1440
126 1680
127 1720
128 2880
129
130 TODO
131 ----
132
133 * LF2CRLF.COM ?
134 * BIN\SHELTAS.COM ...
135 * BIN\SHELTAS2.COM ...
136 * BIN\SHELTA86.COM ...
137 * SHELTA86.ASM ...
138 * ANSI colours in welcome.txt?
139 * welcome.txt in shelta repo?
140 * make ted3, debug, and more, optional, like yasm and perl are optional
141
74142 ]]--
0 @ECHO OFF
1 CLS
2 SET /P size=Enter size of floppy (360, 720, or 1440):
3 IF "%size%"=="360" GOTO OK
4 IF "%size%"=="720" GOTO OK
5 IF "%size%"=="1440" GOTO OK
6 ECHO You must enter either 360, 720, or 1440.
7 GOTO End
8 :OK
9 ECHO -----
10 ECHO About to format your %size%K floppy disk in drive A:.
11 ECHO Just press Enter at the prompts.
12 ECHO If your disk image has never been used used, this process may fail
13 ECHO (in which case, just run this script again, and it should work the
14 ECHO second time.)
15 ECHO -----
16 PAUSE
17 FORMAT A: /F:%size% /S /D
18 PAUSE
19 CLS
20 DIR A:
21 SET /P looksgood=Does the above look ok? [y/n, default=y]:
22 IF NOT "%looksgood%"=="n" GOTO FloppyOK
23 ECHO Please run this script again. It should work better the second time.
24 GOTO End
25 :FloppyOK
26 CLS
27 MKDIR A:\FDOS
28 MOVE A:\COMMAND.COM A:\FDOS\
29 COPY D:\FLOPPY\FDCONFIG.SYS A:\FDCONFIG.SYS
30 ATTRIB -R A:\FDCONFIG.SYS
31 COPY D:\FLOPPY\FDOS\AUTOEXEC.BAT A:\FDOS\AUTOEXEC.BAT
32 ATTRIB -R A:\FDOS\AUTOEXEC.BAT
33 ECHO -----
34 ECHO Done! You now have a basic bootable floppy.
35 ECHO -----
36
37 CALL D:\PUTFLOPY.BAT n y C:\FDOS\BIN\MORE.EXE A:\FDOS\MORE.EXE
38 CALL D:\PUTFLOPY.BAT n y C:\FDOS\BIN\DEBUG.COM A:\FDOS\DEBUG.COM
39 CALL D:\PUTFLOPY.BAT n y C:\FDOS\BIN\NANSI.SYS A:\FDOS\NANSI.SYS
40 CALL D:\PUTFLOPY.BAT n y C:\FDOS\BIN\TED3.COM A:\FDOS\TED3.COM
41 CALL D:\PUTFLOPY.BAT y n C:\FDOS\BIN\YASM.EXE A:\FDOS\YASM.EXE
42 CALL D:\PUTFLOPY.BAT y n C:\DJGPP\BIN\PERL.EXE A:\FDOS\PERL.EXE
43
44 :End
45 ECHO End of script.
0 @ECHO OFF
1 REM Usage: PUTFLOPY cwsdpmi default src dest
2 REM cwsdpmi should be 'y' to install cwsdpmi as a dependency
3
4 SET /P confirm=Install %3 on the floppy? [y/n, default=n]:
5 IF NOT "%confirm%"=="y" GOTO SkipInstall
6 IF "%1"=="y" COPY C:\DJGPP\BIN\CWSDPMI.EXE A:\FDOS\
7 COPY %3 %4
8 :SkipInstall
0 !SHELL=A:\FDOS\COMMAND.COM A:\FDOS /P=A:\FDOS\AUTOEXEC.BAT
1 DEVICEHIGH=A:\FDOS\NANSI.SYS
0 @ECHO OFF
1 SET PATH=A:\FDOS
2 ALIAS EDIT=TED3
3 CLS
4 IF EXIST A:\FDOS\PROJEXEC.BAT CALL A:\FDOS\PROJEXEC.BAT
0 TYPE A:\FDOS\WELCOME.TXT | MORE
1 CD A:\SHELTA
0 Welcome to the Shelta 1.2 FreeDOS disk image for v86!
1
2 * To compile EG\HELLO.SHE to EG\HELLO.COM, type
3
4 bin\shelta n eg\hello ('n' means: use NASM-source compiler)
5
6 then run
7
8 eg\hello
9
10 * To build the bootstrapped compilers, type
11
12 bin\bootstrp
13
14 Then you can build sources with the bootstrapped compilers:
15
16 bin\shelta s eg\99 ('s' means: use stage 1 bootstrapped compiler)
17 bin\shelta s2 eg\demo ('s2' means: use stage 2 bootstrapped compiler)
18
19 * You can also edit Shelta sources with the 'ted3' text editor, like so:
20
21 edit eg\99.she
22
3434 name = 'QEMU/i386',
3535 emulator = QEMU,
3636 command = 'qemu-system-i386 -hda ${SYSTEM_IMAGE}',
37 dist_command = 'qemu-system-i386 -hda ${SYSTEM_IMAGE} -fda ${DIST_IMAGE}',
3738 setup_command = 'qemu-system-i386 -hda ${SYSTEM_IMAGE} -cdrom ${SETUP_IMAGE}',
3839 install_command = 'qemu-system-i386 -hda ${SYSTEM_IMAGE} -cdrom ${INSTALL_IMAGE} -boot order=d',
3940 }
5758 emulator_mode = E_UAE_Amiga_500,
5859 create_system_image = function(funicular, size)
5960 execute(funicular, "mkdir -p ${SYSTEM_IMAGE}")
61 end,
62 create_dist_image = function(funicular, size)
63 execute(funicular, "init_adf ${DIST_IMAGE}")
6064 end
6165 }
6266
6569 emulator_mode = QEMU_i386,
6670 create_system_image = function(funicular, size)
6771 execute(funicular, "dd if=/dev/zero of=${SYSTEM_IMAGE} bs=1M count=" .. size)
72 end,
73 create_dist_image = function(funicular, size)
74 execute(funicular, "dd if=/dev/zero of=${DIST_IMAGE} bs=1K count=" .. size)
6875 end
6976 }
7077
7380 emulator_mode = VICE_x64,
7481 create_system_image = function(funicular, size)
7582 execute(funicular, "init_d64 ${SYSTEM_IMAGE}")
83 end,
84 create_dist_image = function(funicular, size)
85 execute(funicular, "init_d64 ${DIST_IMAGE}")
7686 end
7787 }
7888
8191 emulator_mode = VICE_xvic,
8292 create_system_image = function(funicular, size)
8393 execute(funicular, "init_d64 ${SYSTEM_IMAGE}")
94 end,
95 create_dist_image = function(funicular, size)
96 execute(funicular, "init_d64 ${DIST_IMAGE}")
8497 end
8598 }
8699
144157 command = command:gsub("${SYSTEM_IMAGE}", funicular.system_image or '')
145158 command = command:gsub("${INSTALL_IMAGE}", funicular.install_image or
146159 funicular.platform.install_image or '')
160 command = command:gsub("${DIST_IMAGE}", funicular.dist_image or '')
147161 print(command)
148162 local exit_code = os.execute(command)
149163 if exit_code ~= 0 then
215229 funicular.platform.architecture.create_system_image(funicular, size)
216230 end,
217231
232 initdist = function(funicular, arg)
233 size = arg[2]
234 if size == nil then
235 print "Usage: funicular initdist <size-in-kilobytes>"
236 os.exit(1)
237 end
238 if exists(funicular.dist_image) then
239 print(funicular.dist_image .. " already exists! Delete it first.")
240 return
241 end
242 print("initdist... size: " .. size)
243 funicular.platform.architecture.create_dist_image(funicular, size)
244 end,
245
218246 install = function(funicular, arg)
219247 print("installing " .. funicular.platform.name .. " onto system image...")
220248 if funicular.install_instructions then
279307
280308 start = function(funicular, arg)
281309 print("starting " .. funicular.platform.architecture.emulator_mode.emulator.name .. "...")
282 execute(funicular, funicular.platform.architecture.emulator_mode.command)
310 if funicular.dist_image and exists(funicular.dist_image) then
311 execute(funicular, funicular.platform.architecture.emulator_mode.dist_command)
312 else
313 execute(funicular, funicular.platform.architecture.emulator_mode.command)
314 end
283315 end,
284316
285317 backup = function(funicular, arg)
335367 install
336368 setup
337369 start
370 initdist
338371 backup
339372 restore]]
340373 os.exit(1)