initdist command, and rip stuff from FreeDOS Gondola, broken.
Chris Pressey
10 years ago
2 | 2 | system_image = 'hda.img', |
3 | 3 | work_image = 'fda.img', |
4 | 4 | setup_image = 'freedos-init-cd.iso', |
5 | dist_image = 'a.img', | |
5 | 6 | distfiles = [[ |
6 | 7 | http://www.mirrorservice.org/sites/ftp.delorie.com/pub/djgpp/current/v2/copying.dj |
7 | 8 | http://www.mirrorservice.org/sites/ftp.delorie.com/pub/djgpp/current/v2/djdev203.zip |
60 | 61 | * THEN HIT ENTER AGAIN. It's waiting silently for you. |
61 | 62 | * When finished, you can just stop the emulator. |
62 | 63 | ]], |
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 | ]], | |
63 | 105 | } |
64 | 106 | |
65 | 107 | --[[ |
71 | 113 | |
72 | 114 | # http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.0/fdboot.img |
73 | 115 | #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 | ||
74 | 142 | ]]-- |
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 | @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 | 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 |
34 | 34 | name = 'QEMU/i386', |
35 | 35 | emulator = QEMU, |
36 | 36 | command = 'qemu-system-i386 -hda ${SYSTEM_IMAGE}', |
37 | dist_command = 'qemu-system-i386 -hda ${SYSTEM_IMAGE} -fda ${DIST_IMAGE}', | |
37 | 38 | setup_command = 'qemu-system-i386 -hda ${SYSTEM_IMAGE} -cdrom ${SETUP_IMAGE}', |
38 | 39 | install_command = 'qemu-system-i386 -hda ${SYSTEM_IMAGE} -cdrom ${INSTALL_IMAGE} -boot order=d', |
39 | 40 | } |
57 | 58 | emulator_mode = E_UAE_Amiga_500, |
58 | 59 | create_system_image = function(funicular, size) |
59 | 60 | execute(funicular, "mkdir -p ${SYSTEM_IMAGE}") |
61 | end, | |
62 | create_dist_image = function(funicular, size) | |
63 | execute(funicular, "init_adf ${DIST_IMAGE}") | |
60 | 64 | end |
61 | 65 | } |
62 | 66 | |
65 | 69 | emulator_mode = QEMU_i386, |
66 | 70 | create_system_image = function(funicular, size) |
67 | 71 | 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) | |
68 | 75 | end |
69 | 76 | } |
70 | 77 | |
73 | 80 | emulator_mode = VICE_x64, |
74 | 81 | create_system_image = function(funicular, size) |
75 | 82 | execute(funicular, "init_d64 ${SYSTEM_IMAGE}") |
83 | end, | |
84 | create_dist_image = function(funicular, size) | |
85 | execute(funicular, "init_d64 ${DIST_IMAGE}") | |
76 | 86 | end |
77 | 87 | } |
78 | 88 | |
81 | 91 | emulator_mode = VICE_xvic, |
82 | 92 | create_system_image = function(funicular, size) |
83 | 93 | execute(funicular, "init_d64 ${SYSTEM_IMAGE}") |
94 | end, | |
95 | create_dist_image = function(funicular, size) | |
96 | execute(funicular, "init_d64 ${DIST_IMAGE}") | |
84 | 97 | end |
85 | 98 | } |
86 | 99 | |
144 | 157 | command = command:gsub("${SYSTEM_IMAGE}", funicular.system_image or '') |
145 | 158 | command = command:gsub("${INSTALL_IMAGE}", funicular.install_image or |
146 | 159 | funicular.platform.install_image or '') |
160 | command = command:gsub("${DIST_IMAGE}", funicular.dist_image or '') | |
147 | 161 | print(command) |
148 | 162 | local exit_code = os.execute(command) |
149 | 163 | if exit_code ~= 0 then |
215 | 229 | funicular.platform.architecture.create_system_image(funicular, size) |
216 | 230 | end, |
217 | 231 | |
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 | ||
218 | 246 | install = function(funicular, arg) |
219 | 247 | print("installing " .. funicular.platform.name .. " onto system image...") |
220 | 248 | if funicular.install_instructions then |
279 | 307 | |
280 | 308 | start = function(funicular, arg) |
281 | 309 | 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 | |
283 | 315 | end, |
284 | 316 | |
285 | 317 | backup = function(funicular, arg) |
335 | 367 | install |
336 | 368 | setup |
337 | 369 | start |
370 | initdist | |
338 | 371 | backup |
339 | 372 | restore]] |
340 | 373 | os.exit(1) |