User Tools

Site Tools


operating_systems:freedos

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
operating_systems:freedos [2021/03/21 22:58]
nanodano
operating_systems:freedos [2022/03/21 23:53] (current)
nanodano [Dealing with JemmEx out of memory error]
Line 15: Line 15:
 - To learn more about operating systems, history, programming, graphics - To learn more about operating systems, history, programming, graphics
 - For fun of retro computing - For fun of retro computing
-- Portable - anyone can run it, low system requirements. Run it on a 40 year old computer up to a modern 2021 computer. The x86 chips we have in all of our desktops are backwards compatible to the 16-bit 8086. They will mimic it. It will run on anything running current era hardware with x86 instructions! Really cool! People with powerful hardware can run the DosBox emulator in a host operating system.+- Portable - anyone can run it, low system requirements. Run it on a 40 year old computer up to a modern 2021 computer. The x86 chips we have in all of our desktops are backwards compatible to the 16-bit 8086. They will mimic it. It will run on anything running current era hardware with x86 instructions! Really cool! 
 + 
 +===== DosBox vs FreeDOS ===== 
 + 
 +DosBox vs FreeDOS (One is an emulator meant to run on a host operating system, one is an actual OS that runs on hardware or a virtual x86 machine)
  
  
-DosBox vs FreeDOS (One is an emulator, one is a true OS) 
  
-DOS is single user/no user. Always root access to everything. 
  
  
Line 26: Line 28:
 ===== Installing ===== ===== Installing =====
  
-Download and installed. 
-Run it 
-https://www.dosbox.com 
-`mount c ~` will mount your home directory to C:\ 
-## Installing FreeDOS 
  
-Video on installing manually: https://www.youtube.com/watch?v=krbYBZr2ISw (Load live environment, use `fdisk` to partition disk, `format C: /sto wipe drive and make bootable by copying system files, then get packages from \PACKAGES\BASE with `for %f in (*.ZIP) do unzip %f -x SOURCE/* -d C:\FDOS`)+ 
 +==== Minimal manual installation ==== 
 + 
 +Video on installing manually: [[https://www.youtube.com/watch?v=krbYBZr2ISw]] 
 + 
 + 
 +Steps: 
 + 
 +  - Partition the disk with ''fdisk'' 
 +  - Create a file system on the partition with ''format'' 
 +  - Make the disk bootable and copy kernel with ''sys'' 
 +  - Optionallyinstall any desired packages by unzipping and copying them over 
 + 
 +<code> 
 +# Partition the disk, create file system, make bootable 
 +# and install the kernel.sys + command.com 
 +fdisk 
 +# Reboot after this doing fdisk! 
 +format d: 
 +sys d: 
 + 
 +## Example of how to "install" packages from Base group 
 +C: 
 +cd \PACKAGES\BASE 
 +# `-x SOURCE/*will exclude files in source directories 
 +# `-d sets the destination directory, where unzipped files go 
 +for %f in (*.ZIP) do unzip %f -x SOURCE/* -d d:\FreeDOS 
 +</code> 
 + 
 +By performing those steps, you have a minimal bootable system. There will only be two files on the drive:  
 + 
 +  * ''KERNEL.SYS'' - The FreeDOS kernel itself 
 +  * ''COMMAND.COM'' - The command prompt and built-in commands. Akin to Bash or BusyBox. This provides the ''C:\>'' prompt. 
 + 
 +If you boot up and get a prompt, excellent. Type ''?'' to get a list of built-in commands and features. You should see features like history, tab completion, directory stacks (''pushd''/''popd''), last directory (''cd -''). 
 + 
 +Example steps: 
 + 
 +  * Boot into the Live mode from the install disk 
 +  * Run ''fdisk'' and setup a partition 
 +  * Run ''format d:'' to setup a file system on the partition created. Can include ''/s'' makes it bootable by copying system files (''KERNEL.SYS'' and ''COMMAND.COM'') or do the next step manually 
 +  * Run ''sys d:'' to copy the boot sector to d drive and kernel. 
 +  * At this point the system should be bootable and you will load into the typical ''C:\>'' prompt with only two files on the system. Type ''?'' for list of builtin commands. 
 +  * To install additional applicationunzip programs from the ''PACKAGES'' directory. 
 +    * The ''BASE'' package is everything needed to recreate basic DOS environment. 
 +    * To see what is in a zip file, ''unzip -l'' like ''unzip -l tree.zip'' 
 +    * To install everything in a directory (omit -x if you do not want to exclude sources): ''cd \PACKAGES\BASE'' and ''for %f in (*.ZIP) do unzip %f -x SOURCE/* -d d:\FDOS'' or ''d:\FreeDOS'' in newer version. 
 +  *  
 + 
 + 
 +==== Use installer ==== 
  
 Recommended FULL install with source. The FULL install will give you the package manage `fdimples`. Recommended FULL install with source. The FULL install will give you the package manage `fdimples`.
Line 47: Line 95:
   -   -
  
-## How kernel boot works and fdconfig.sys+ 
 + 
 +==== Dealing with JemmEx out of memory error ==== 
 + 
 +[[https://www.youtube.com/watch?v=Q72PYNwHrHw]] 
 + 
 +Edit ''C:\fdconfig.sys'' to choose different memory option in menu. Try setting the default menu item to the one that loads no drivers at all. For me, option 3, the HIMEM one worked. 
 + 
 +Also refer to [[http://wiki.freedos.org/wiki/index.php/VirtualBox_-_Bugs:_JEMMEX]] which recommends making the following modification to the JemmEx option: 
 + 
 +<code> 
 +Change from this 
 +1?DEVICE=C:\FDOS\BIN\JEMMEX.EXE NOEMS X=TEST I=TEST NOVME NOINVLPG 
 +to this 
 +1?DEVICE=C:\FDOS\BIN\JEMMEX.EXE NOEMS X=TEST I=B000-B7FF I=C800-EFFF NOVME NOINVLPG 
 +</code> 
 + 
 +==== Dealing with unable to read hard disk error ==== 
 + 
 +When you use ''fdisk'' to partition the drive, it will initially ask you if you want to use large disks and format with FAT32. If you choose YES, you might end up getting errors when it tries to read the disk later. To solve this, choose NO when it asks you if you want to use extended disks. This will only use FAT16, whicht will limit you to 2GB max disk sizes. However, you can create one primary DOS partition of 2GB and then create an extended partition with numerous 2GB logical partitions. This way you can have an ''E:\'', ''F:\'', ''G:\'', ''H:\\'', etc, each of 2GB. 
 + 
 +You can create one primary DOS partition 
 + 
 +===== How kernel boot works and fdconfig.sys =====
  
 https://www.youtube.com/watch?v=KQvJGoc-KfU https://www.youtube.com/watch?v=KQvJGoc-KfU
Line 63: Line 134:
  
  
-## Explanation of files+===== Explanation of files =====
  
 Here are the files. That's it. That's the whole operating system. Here are the files. That's it. That's the whole operating system.
  
  
-- `AUTOEXEC.BAT- Put all your stuff here. Like your init scripts and bash profile in one +  * ''AUTOEXEC.BAT'' - Put all your stuff here. Like your init scripts and bash profile in one. In 1.3rc5 this has been renamed to ''FDAUTO.BAT''. 
-- `COMMAND.COM+  * ''COMMAND.COM'' The built-in shell, akin to BusyBox or Bash. 
-`FDCONFIG.SYS- Boot configuration, menu configuration +  * ''FDCONFIG.SYS'' - Boot configuration, menu configuration 
-- `KERNEL.SYS- The kernel binary itself. 48 KB! +  * ''KERNEL.SYS'' - The kernel binary itself. 48 KB! 
-- `FDOS\+  * ''FDOS\'' In newer versions like 1.3rc5, ''C:\FreeDOS'' instead. 
-`FDOS\BIN\- Executables+  * ''FDOS\BIN\'' - Executables
  
-===== Basic commands ===== 
  
-`?``help`, Adding ` /?`+===== Getting help ===== 
 + 
 +You can always type ''?'' to get a list of the built-in commands. This will be available even if you did the absolute minimal install with ''fdisk'' -> ''format'' -> ''sys'' and you only have ''KERNEL.SYS'' and ''COMMAND.COM'' as the only two files on disk. 
 + 
 +<code> 
 +? 
 +</code> 
 + 
 +- ''?''''help'' 
 + 
 + Adding ` /?` 
 + 
 +<code> 
 + 
 +dir /? 
 +</code> 
 + 
 + 
 +===== Built-in commands ===== 
 + 
 +Built-in commands that come with ''COMMAND.COM'': 
 + 
 +Enter: ''?'' to see. 
 + 
 +Built-in commands: 
 + 
 +  * ''path'' - Display executable paths 
 +  * ''echo'' - Print text to terminal 
 +  * ''cls'' - Clear the screen 
 +  * ''which'' - Find where an executable is located. E.g. ''which fdisk'' 
 +  * ''vol'' - Disk volume information. E.g. ''vol d:'' 
 +  * ''mkdir''/''rmdir'', ''cd''/''chdir'', ''del'' ''rename'' 
 +  * ''for'', ''rem'', ''goto'', ''break'' - For loops and comments (mostly for batch scripting) 
 +  * ''pause'' - "Press any key to continue..." that will wait before continuing 
 +  * ''ver'' - Print version of Command.com (FreeCom) 
 +  * ''copy''/''del'' 
 + 
 +There are also built-in features like: 
 + 
 +  * Directory stack (''pushd''/''popd''/''dirs''
 +  * Last directory (''cd -''
 +  * History (''history''
 +  * Tab completion 
 +  * Aliases (''alias''
 +  * Enhanced input 
 - `ver`, `vol`, `mem`, `cls`, `which`, `path` - `ver`, `vol`, `mem`, `cls`, `which`, `path`
 - `cd`, `dir`, `dir /w`, `tree`, `| more`, `mkdir`, `echo hi > test.txt`, `rmdir`, `deltree` - `cd`, `dir`, `dir /w`, `tree`, `| more`, `mkdir`, `echo hi > test.txt`, `rmdir`, `deltree`
Line 96: Line 211:
 Vim can be installed in 1.3! Vim can be installed in 1.3!
  
-```+<code>
 EDIT EDIT
 C:\FED\FED.EXE C:\FED\FED.EXE
 C:\VIM\VIM.EXE C:\VIM\VIM.EXE
-```+</code> 
 + 
 +===== Batch scripting ===== 
 + 
 +Even in the most minimal install, you have ''COMMAND.COM'' which is the shell that has built-in commands. This shell is scriptable, like Bash. The scripts are called Batch scripts and end with a ''.BAT'' extension. 
 + 
 +<code batch> 
 +REM Add comments with REM. It stands for REMARK 
 +for %f in (*.ZIP) do unzip %f -x SOURCE/* -d d:\FreeDOS 
 + 
 +REM Turn off echo with: 
 +@echo off 
 + 
 +REM Set environment variables with set 
 +set 
 +</code> 
 + 
 + 
 +===== Mounting USB & CD drives ===== 
  
  
 ===== Get software ===== ===== Get software =====
  
-https://www.dosbox.com +  * [[https://www.freedos.org/links/]] 
-https://archive.org/details/softwarelibrary_msdos +  * [[https://www.freedos.org/software/]] 
-https://www.freedos.org/software/+  * [[https://www.dosbox.com]] 
 +  * [[https://archive.org/details/softwarelibrary_msdos]] 
 +  * [[http://dosprograms.info.tt/]]
  
-==== Using fdimples on FreeDOS ====+==== Using fdimples package manager ====
  
 Insert the FreeDOS CD-ROM, then run `fdimples` to get the software repository screen. Insert the FreeDOS CD-ROM, then run `fdimples` to get the software repository screen.
Line 129: Line 265:
 - Dialog - Dialog
 - sqlite - sqlite
 +- FDTUI (better than FDSHELL which runs at 100% cpu) - ''dosshell'' - terminal-based Windows system with mouse support
 +- IMGEDIT ''imgview'' and ''imgedit'' like Paint
 +- pmge ''pgm'' - a menu system for running programs
  
 ==== Installing manually in FreeDOS ==== ==== Installing manually in FreeDOS ====
Line 177: Line 316:
 Text Browser: Links C:\Links\links.exe Text Browser: Links C:\Links\links.exe
 GUI Browser: Dillo C:\DILLO\DILLO.exe GUI Browser: Dillo C:\DILLO\DILLO.exe
 +GUI Browser: Arachnae
 ===== Programming ===== ===== Programming =====
  
Line 183: Line 322:
 === Languages === === Languages ===
  
-Lua: `C:\DEVEL\LUA\LUA.EXE` +  * Lua: ''C:\DEVEL\LUA\LUA.EXE'' 
-Assembly: `fasm``jwasm``nasm` +  Assembly: ''fasm''''jwasm''''nasm'' 
-BASIC:  `FBC(FreeBasic 32-bit compiler) +  BASIC:  ''FBC'' (FreeBasic 32-bit compiler) 
-C: `bcc(Bruce's C compiler), `gcc(djgpp C/C++ compiler), `owOpen Watcom C/C++ Compiler +  C: ''bcc'' (Bruce's C compiler), ''gcc'' (djgpp C/C++ compiler), ''ow'' Open Watcom C/C++ Compiler 
-Pascal: `FPC`+  Pascal: ''FPC''
  
-== NASM ==+== NASM hello world ==
  
-Similar to the Linux hello world program except `int 80hwon't work because that's a Linux interrupt. In DOS its `int 21`+Similar to the Linux hello world program except ''int 80h'' won't work because that's a Linux interrupt. In DOS its ''int 21'' 
 + 
 +== VGA programming == 
 + 
 +Screen 13! How to do it in assembly with interrupt, and how to do it in BASIC with SCREEN 13. Where is the VGA memory location. It's as easy as writing to the memory location.
  
 == Lua == == Lua ==
Line 198: Line 341:
  
 == BASIC == == BASIC ==
 +
 += BWBASIC =
 +
 +Bytewater must be run with a 32-bit protected mode DOS extender like ''dos32a''.
 +
 +<code>
 +dos32a bwbasic.exe
 +</code>
 +
 += FreeBASIC =
  
 https://www.youtube.com/watch?v=tIGokkohQho https://www.youtube.com/watch?v=tIGokkohQho
Line 213: Line 366:
 ``` ```
  
-== C ==+== C/C++ =
 + 
 + 
 + 
 += OpenWatcom = 
 + 
 +  * There is ''conio.h'' for terminal (like ncurses) 
 +  * and ''graph.h'' for doing graphics 
 + 
 +<code> 
 +REM Without this env var, linker fails 
 +set WATCOM=C:\devel\watcomc 
 + 
 +REM wcc, wpp, wlink - compilers & linker 
 +REM wcl - compile and link in one 
 +wcl hello.cpp /IC:\devel\watcomc\h 
 + 
 +REM TO allow the omission of /I flag set INCLUDE 
 +set INCLUDE=C:\devel\watcomc\h 
 + 
 +REM Now you can simply compile & link with: 
 +wcl hello.cpp 
 +</code> 
 + 
 += DJGPP =
  
 Make sure DJGPP is installed from the FreeDOS CD-ROM using `fdimples`. Make sure DJGPP is installed from the FreeDOS CD-ROM using `fdimples`.
operating_systems/freedos.1616367502.txt.gz · Last modified: 2021/03/21 22:58 by nanodano