Using alias is like creating an in-memory shortcut I think, It's really a good way to keep our path list clean and safe. Looking forward form more programming related videos. Thanks Jim,
The problem is, aliases do only work in FreeDOS 1.3. They do not work in MS-DOS or DR-DOS. And this is the reason, why is use a different approach. Read my comment in my own thread above. There i described it.
I am not yet retired but I have some freetime and was wanting to learn C on DOS. I got into hardware and software in 1996, and have been in it since, but my programming has never been good lol. I figured this would tickle my nostalgia as well as allow me to utilize my K&R that has been collecting dust. Thank you for FreeDOS!
@@freedosproject Yes, but I would prefer FDIMPLES to work with catalog files that allow them to be installed on hard disk. This would allow the user to browse the catalog without having to insert the appropriate CD-ROM into the CD-ROM drive. It is very inconvenient to have to change the inserted CD-ROM every time just because a certain package is on the second FreeDOS installation CD. It would be easier if you could see in advance which CD-ROM contains which package, and for this it would be necessary to install the catalogs on the hard disk.
From the late 1980's until 2004 when I moved lock-stock-and-barrel to the first version of Ubuntu, I used an editor VDE with Wordstar commands similar to the Borland editors. I could rapidly change between editing and compile modes with a keystroke sequence and spent years with pascal programs edited in VDE and compiled from the command line. Apart from that VDE is a very fast, highly capable editor and will be well worth a review. There used to be a Google Sites page dedicated to VDE that is still available on the Internet Archive. There is also an actively shared torrent file with the VDE binaries.
I think every new programmer should know a bit of C. Even if you don't learn enough to write a complex program like a kernel or even an editor, knowing some C helps you write better code in other programming languages.
@@freedosproject I find C and BASIC a good base as most common languages build from those principles. I wrote a beginners book using C, FreeBASIC and Python for the examples and the code flow is the same across all 3 almost line for line.
Thanks! Programming on DOS definitely comes with some interesting limitations. For example, sometimes I see programmers on Linux or Windows who load an entire file into memory just to do some simple task (like look up a single value in a config file .. or in an extreme case, just to convert the entire file to lowercase). And they do that because on modern systems, memory is "cheap." But you can't take that approach on DOS because of memory limitations. So you need to be more careful and intentional about how you write DOS programs. I find it makes for a more interesting programming challenge.
@@freedosprojectQuite right. The limitations are what make it a special challenge. I used QBASIC many years ago and learned more because I had limitations to make me be creative. Now I am trying to do C programming on DOS because I haven’t had that experience before.
Hey Jim, Thank you for these and all the work you do. This almost exceeds the sum of all other retro platform activities. Although, worth noting DOS is still used and not just for nostalgia. Off you’re ever looking for topic ideas, I’d love to see more about build automation (GitHub actions), and how to structure your code (for something you’ve done) if you were targeting another platform. There’s lots of cool stuff targeting Amiga and Atari ST, or console Linux, that would be nice to have. Sorry for so many ideas, been meaning to post for a while, cheers. Also, can Freedos boot an image off the internet (like if you built remotely) or is that something nobody has built yet?
I can definitely do a video about writing code that will target both FreeDOS and Linux as different build environments. That would be a good opportunity to talk about "#if defined(__)" in a program, such as writing a function that picks a random number using rand() on DOS, but getrandom() on Linux. I'll add that to the list! I don't know if FreeDOS can be loaded as a PXE boot, I've never tried.
@@freedosproject I tried it with PXE on a server mainboard with a IPMI BMC module and it works. But the old FreeDOS 1.2 CD wasn't a live CD. Thus i had to create a DOS system running from a USB stick and boot normally.
Yes, you definitely can. (And some of our developers do that too.) But I prefer the open source compilers like IA-16 GCC and OpenWatcom C, so that's usually what I highlight on the channel.
John Carmack from ID Software wrote DOOM with WatcomC, he did not use Turbo C for this. If i remember correctly, Turbo C does support only the typical real mode memory models. WatcomC was shipped with a DOS4/GW DOS extender, which allowed to program DOOM for protected mode.
hi, im a bit new to dos and id love some help: I teach asm and I want to show my students how a compiler outputs asm for that I want to see the asm output of my compiler. so far it's simple enough as gcc with the -S flag would do what I want but I need preferably 16bit or maybe 8 bit code as that is what I teach and I want my student's to recognize the output so after giving up on gcc as it outputs 32bit code even with the -M16 flag I thought that if I just run a dos environment im bound to get something close to what I want I followed your tutorial and compiled a small hello world as well as compiling it with the -S flag to see the obj file, but when I opened it I can only see random chars (the file is already translated to machine code rather than asm) is there a better way to do what im trying to do? additionally im not sure if it will be a problem later but id preferably want to use TASM as my assembler again because that is what my students will understand best, however any similar syntax would also be fine any help would be much appreciated :)
It's easy! There's a Config menu in FED where you can change the colors. Here's a video where I show how I set my favorite colors: th-cam.com/video/eXeTaRlyQdU/w-d-xo.html
Thanks, that's an interesting alternative to what I do, although simple enough :) I'm using DJGPP at the moment which has the environment variable set in a DJGPP.ENV but I keep a distinct copy of FED224B in my DJGPP directory (and separate FED for each other compiler). The FED install is only for DJGPP. Add a DJFED.BAT in my \LINKS directory (In the system path) with the DJGPP PATHS and environment variable DJGPP= . The FED install is unique to that compiler and I store the FED set up in the same location. I'm lazy so I add 2 (or more) batch files in the DJGPP root directory with the call to each batch file in the Tools menu (Like a typical IDE). The Compile.BAT and RUN.BAT take the source name from FED %f and carry out the compiler commands a bit like a make file. So Basically FED acts as the IDE with control over the compiler commands :)
Sounds like a good option. These days, disk is cheap so you can have a different copy of FED for every compiler (such as one that's geared with key shortcuts and colors that mimics one IDE, and so on). And FED is a pretty small editor, so it doesn't take up a lot of space anyway. In the days when disk was more expensive and disks were smaller, I might have done that with a single FED install and a FED.BAT that copied the FED.CFG config file I wanted. Keep multiple FED.CFG files, but one FED install. Different ways to do the same thing. ☺
Does FreeDOS support multicore programming? One of the reasons the MS went away from DOS was create a layer of abstraction to prevent programmers to interacting directly with system hardware (eg. serial ports. parallel ports, RTC, etc.). If FreeDOS supports multicore processors, you should do a video on FreeDOS handles core and process thread scheduling.
DOS ist only a *Disk* operating system. If we can speak of process handling at all, then it only handles one process at a time and TSR is a workaround. There is no multithreading, no multitasking and no time sharing of processes. Allowing the programs to have full access to the hardware also means, that you have to implement multicore programming on your own on an application level. I would also assume that multicore programming requires the CPU to run in protected Mode. So to sum it up, DOS is not the system you want to use for that task. If you want have full access to your hardware and multicore support, then write a driver for Linux. And no, the reason why MS went away from DOS was definitely not to create a layer of abstractions to prevent programmers to interacting directly with the system hardware. The layer of abstractions to separate kernel space from user space is a thing a modern operating system should support. Windows NT did this. The abstractions increases security and allows a unified API layer to access different hardware from different manufacturers the same way. It was a blessing. It ended the requirement to write different code just to support different hardware on the application level.
Run the FDIMPLES program to run the package installer. Note that some programs are included on the BonusCD, so you may need to download that to get all the programs you want. Because FreeDOS is just DOS, you can also download any DOS program and install it the usual way too. You don't always have to go through the package manager.
The environment space will be one of the first things allocated when FreeCOM starts up, but it's not "locked" to some specific location in memory. And it has to be, because you can run one instance of FreeCOM inside another instance of FreeCOM (such as testing) and they'll each have their own environment.
I don't really do much assembly programming, so I don't plan to do any videos about writing drivers. But I could do a video about "writing your first DOS assembly program" using NASM on FreeDOS. I'll add that to the list of upcoming videos. [I'm behind on the videos, I hope to post more videos very soon.]
These days, I don't write huge applications in C, just tools that process text, turn based games, emulators, or some other program to do some specific thing. If it's not interactive, my debugging is usually just a *printf* or *puts* statement here or there, usually controlled like this: #if defined(DEBUG) printf("in process_line() .. linelen is %d ", linelen); #endif Then when I compile, I can use -DDEBUG to turn "on" debugging statements. And omit -DDEBUG to turn "off" debugging statements.
You need to have a DOS driver for your network card if you want to connect to a network on real hardware. But on Intel's website, I only see a Killer E2200 driver for Windows. Maybe another driver will work?
@@freedosproject ok thanks for quick response i thought you stopped this channel, if you are right about drivers then what is the point to still use this os? as i understand it doesn't support modern things i am just started reading book called "viruses in ms dos" by kasperskiy and i see a lot of new stuff about pc so is it a good idea to use freedos for observing stuff? it will be still hard cause i will have to use my phone for surfing while booted in freedos on pc
I tried every key combination I could think of but I can't find a way to type "\" in dos editor. can anybody help me fix this issue? I'm using a French keyboard layout
I adore DOS still being used, for “real work” or fun, it’s still great.
Thanks! 👍
Using alias is like creating an in-memory shortcut I think,
It's really a good way to keep our path list clean and safe.
Looking forward form more programming related videos.
Thanks Jim,
Glad you liked it!
The problem is, aliases do only work in FreeDOS 1.3. They do not work in MS-DOS or DR-DOS. And this is the reason, why is use a different approach. Read my comment in my own thread above. There i described it.
I am not yet retired but I have some freetime and was wanting to learn C on DOS. I got into hardware and software in 1996, and have been in it since, but my programming has never been good lol. I figured this would tickle my nostalgia as well as allow me to utilize my K&R that has been collecting dust. Thank you for FreeDOS!
Glad you like it! We have lots of great C compilers in FreeDOS, too.
Wow 😳😲 a package mgr for DOS. Incredible!
Jerome did a great job with FDIMPLES ☺
@@freedosproject Yes, but I would prefer FDIMPLES to work with catalog files that allow them to be installed on hard disk. This would allow the user to browse the catalog without having to insert the appropriate CD-ROM into the CD-ROM drive.
It is very inconvenient to have to change the inserted CD-ROM every time just because a certain package is on the second FreeDOS installation CD. It would be easier if you could see in advance which CD-ROM contains which package, and for this it would be necessary to install the catalogs on the hard disk.
They can take our lives, but they will never take... OUR FreeDOS!!
That was brief and useful. Thank you for sharing it.
Glad it was helpful! Some folks have asked about it, so I figured I should finally do a video about it.
From the late 1980's until 2004 when I moved lock-stock-and-barrel to the first version of Ubuntu, I used an editor VDE with Wordstar commands similar to the Borland editors. I could rapidly change between editing and compile modes with a keystroke sequence and spent years with pascal programs edited in VDE and compiled from the command line. Apart from that VDE is a very fast, highly capable editor and will be well worth a review. There used to be a Google Sites page dedicated to VDE that is still available on the Internet Archive. There is also an actively shared torrent file with the VDE binaries.
Ability to write c on this is essential for today
I think every new programmer should know a bit of C. Even if you don't learn enough to write a complex program like a kernel or even an editor, knowing some C helps you write better code in other programming languages.
@@freedosproject I find C and BASIC a good base as most common languages build from those principles. I wrote a beginners book using C, FreeBASIC and Python for the examples and the code flow is the same across all 3 almost line for line.
i recently started my programming journey and i have to admit the novelty of practising my C in dos has definitely made it more exciting
Thanks! Programming on DOS definitely comes with some interesting limitations. For example, sometimes I see programmers on Linux or Windows who load an entire file into memory just to do some simple task (like look up a single value in a config file .. or in an extreme case, just to convert the entire file to lowercase). And they do that because on modern systems, memory is "cheap." But you can't take that approach on DOS because of memory limitations. So you need to be more careful and intentional about how you write DOS programs. I find it makes for a more interesting programming challenge.
@@freedosprojectQuite right. The limitations are what make it a special challenge. I used QBASIC many years ago and learned more because I had limitations to make me be creative. Now I am trying to do C programming on DOS because I haven’t had that experience before.
@@freedosproject I started out on a OS C1P and C4P with 8kb and 12kB of RAM. You learn real fast to be conservative with RAM lol
Interesting!
We can put tiny batch files in the path directory to start applications (using drive and folder) that are not in the path.
Yes, that works too!
That's my way in MS-DOS. I created them in a folder C:\BIN, analogue to unix/linux.
I just place all my APP launch batch files in \FREEDOS\LINKS as it is already in the path.
Hey Jim, Thank you for these and all the work you do. This almost exceeds the sum of all other retro platform activities. Although, worth noting DOS is still used and not just for nostalgia. Off you’re ever looking for topic ideas, I’d love to see more about build automation (GitHub actions), and how to structure your code (for something you’ve done) if you were targeting another platform. There’s lots of cool stuff targeting Amiga and Atari ST, or console Linux, that would be nice to have. Sorry for so many ideas, been meaning to post for a while, cheers.
Also, can Freedos boot an image off the internet (like if you built remotely) or is that something nobody has built yet?
I can definitely do a video about writing code that will target both FreeDOS and Linux as different build environments. That would be a good opportunity to talk about "#if defined(__)" in a program, such as writing a function that picks a random number using rand() on DOS, but getrandom() on Linux. I'll add that to the list!
I don't know if FreeDOS can be loaded as a PXE boot, I've never tried.
@@freedosproject I tried it with PXE on a server mainboard with a IPMI BMC module and it works. But the old FreeDOS 1.2 CD wasn't a live CD. Thus i had to create a DOS system running from a USB stick and boot normally.
nice to see that c: prompt back again, can we run those turbo c, turbo basic, turbo pascal in freedos?
I ran turbo c in it last year quite a bit
Yes, you definitely can. (And some of our developers do that too.) But I prefer the open source compilers like IA-16 GCC and OpenWatcom C, so that's usually what I highlight on the channel.
John Carmack from ID Software wrote DOOM with WatcomC, he did not use Turbo C for this. If i remember correctly, Turbo C does support only the typical real mode memory models. WatcomC was shipped with a DOS4/GW DOS extender, which allowed to program DOOM for protected mode.
Love to write TSRs during dos era, in a way, if properly disigned, u can simulate muti tasking by hooking timer interrupt
hi, im a bit new to dos and id love some help:
I teach asm and I want to show my students how a compiler outputs asm
for that I want to see the asm output of my compiler.
so far it's simple enough as gcc with the -S flag would do what I want but I need preferably 16bit or maybe 8 bit code as that is what I teach and I want my student's to recognize the output
so after giving up on gcc as it outputs 32bit code even with the -M16 flag I thought that if I just run a dos environment im bound to get something close to what I want
I followed your tutorial and compiled a small hello world as well as compiling it with the -S flag to see the obj file, but when I opened it I can only see random chars (the file is already translated to machine code rather than asm) is there a better way to do what im trying to do?
additionally im not sure if it will be a problem later but id preferably want to use TASM as my assembler again because that is what my students will understand best, however any similar syntax would also be fine
any help would be much appreciated :)
I think you should try the IA-16 GCC compiler. You can find it on the FreeDOS 1.3 Bonus CD. It is GCC except targeted for 16-bit CPUs, and generates exactly what you're looking for. Here's the assembly output (-S option) from a "Hello world" program:
.arch i8086,jumps
.code16
.att_syntax prefix
#NO_APP
.section .rodata
.LC0:
.string "hello world"
.text
.global main
.type main, @function
main:
pushw %bp
movw %sp, %bp
movw $.LC0, %ax
pushw %ax
pushw %ss
popw %ds
call puts
addw $2, %sp
movw $0, %ax
movw %ax, %ax
movw %ax, %ax
movw %bp, %sp
popw %bp
pushw %ss
popw %ds
ret
.size main, .-main
.ident "GCC: (GNU) 6.3.0"
And the original C source:
#include
int
main()
{
puts("hello world");
return 0;
}
@@freedosproject this is exactly what I was looking for, thanks a lot :)
I have a 4GB USB with FreeDOS and I enjoy using it!
Glad you like it! ☺
Very Cool
Very informative video! One question though: How do you change the colors in fed? For example, I want to have green text on black background
It's easy! There's a Config menu in FED where you can change the colors. Here's a video where I show how I set my favorite colors: th-cam.com/video/eXeTaRlyQdU/w-d-xo.html
Good video
Glad you enjoyed it!
I like to use debug for programming tiny DOS executable and i put all instructions into batch files.
Thanks, that's an interesting alternative to what I do, although simple enough :)
I'm using DJGPP at the moment which has the environment variable set in a DJGPP.ENV but I keep a distinct copy of FED224B in my DJGPP directory (and separate FED for each other compiler).
The FED install is only for DJGPP. Add a DJFED.BAT in my \LINKS directory (In the system path) with the DJGPP PATHS and environment variable DJGPP= .
The FED install is unique to that compiler and I store the FED set up in the same location.
I'm lazy so I add 2 (or more) batch files in the DJGPP root directory with the call to each batch file in the Tools menu (Like a typical IDE). The Compile.BAT and RUN.BAT take the source name from FED %f and carry out the compiler commands a bit like a make file. So Basically FED acts as the IDE with control over the compiler commands :)
Sounds like a good option. These days, disk is cheap so you can have a different copy of FED for every compiler (such as one that's geared with key shortcuts and colors that mimics one IDE, and so on). And FED is a pretty small editor, so it doesn't take up a lot of space anyway.
In the days when disk was more expensive and disks were smaller, I might have done that with a single FED install and a FED.BAT that copied the FED.CFG config file I wanted. Keep multiple FED.CFG files, but one FED install.
Different ways to do the same thing. ☺
Does FreeDOS support multicore programming? One of the reasons the MS went away from DOS was create a layer of abstraction to prevent programmers to interacting directly with system hardware (eg. serial ports. parallel ports, RTC, etc.). If FreeDOS supports multicore processors, you should do a video on FreeDOS handles core and process thread scheduling.
🤣
DOS ist only a *Disk* operating system. If we can speak of process handling at all, then it only handles one process at a time and TSR is a workaround. There is no multithreading, no multitasking and no time sharing of processes. Allowing the programs to have full access to the hardware also means, that you have to implement multicore programming on your own on an application level. I would also assume that multicore programming requires the CPU to run in protected Mode.
So to sum it up, DOS is not the system you want to use for that task.
If you want have full access to your hardware and multicore support, then write a driver for Linux.
And no, the reason why MS went away from DOS was definitely not to create a layer of abstractions to prevent programmers to interacting directly with the system hardware. The layer of abstractions to separate kernel space from user space is a thing a modern operating system should support. Windows NT did this. The abstractions increases security and allows a unified API layer to access different hardware from different manufacturers the same way. It was a blessing. It ended the requirement to write different code just to support different hardware on the application level.
mphello.s file from the University of San Francisco
@@OpenGL4ever But a DOS application can startup all cores.
@@maxmuster7003 That's what i said.
Have you also done a video showing how you do these videos? They're really good.
Great idea! Until I do, here's an article I wrote 2 years ago about how I use OBS: opensource.com/article/21/4/obs-youtube
Does QuickBasic 4.5 run in FreeDOS?
What C compiler do you prefer for FreeDOS? What compiler you'd recommend for 386SX: TC, WC, DJGPP or else?
I have two favorite C compilers on FreeDOS right now: I love the IA16 GCC by TK Chia and others, and I love using OpenWatcom C.
What CPU is in your developent PC?@@freedosproject
When will FreeDOS be available on a ROM chip? I hope oh so very soon.
Thanks for sharing, I love the C language, that this system lets me do this, I love it, greetings from Mexico.☺
Glad it was helpful!
I have installed freedos on virtualbox, but how do I get this screen out where you select the packages to install?
Run the FDIMPLES program to run the package installer. Note that some programs are included on the BonusCD, so you may need to download that to get all the programs you want.
Because FreeDOS is just DOS, you can also download any DOS program and install it the usual way too. You don't always have to go through the package manager.
Is there a fix memory location for the enviroment variables, or is the memory location changing on driver loading, stacks and buffer size?
The environment space will be one of the first things allocated when FreeCOM starts up, but it's not "locked" to some specific location in memory. And it has to be, because you can run one instance of FreeCOM inside another instance of FreeCOM (such as testing) and they'll each have their own environment.
@@freedosproject Now i understand, thank you.
You mentioned an emulator that you are running FreeDOS on. Which one is it? Thanks.
I used to use VirtualBox, but these days I almost always use QEMU. Here's my video about QEMU on Linux:
th-cam.com/video/Se69XJWxwAc/w-d-xo.html
How are braces made?
CAn you make a video about writing hello-world driver for DOS that could be loaded in config.sys?
I don't really do much assembly programming, so I don't plan to do any videos about writing drivers. But I could do a video about "writing your first DOS assembly program" using NASM on FreeDOS. I'll add that to the list of upcoming videos. [I'm behind on the videos, I hope to post more videos very soon.]
It's a pity, writing a driver for DOS was my childhood dream. Might you know is there any documentation to read?@@freedosproject
How do you do debugging?
These days, I don't write huge applications in C, just tools that process text, turn based games, emulators, or some other program to do some specific thing. If it's not interactive, my debugging is usually just a *printf* or *puts* statement here or there, usually controlled like this:
#if defined(DEBUG)
printf("in process_line() .. linelen is %d
", linelen);
#endif
Then when I compile, I can use -DDEBUG to turn "on" debugging statements. And omit -DDEBUG to turn "off" debugging statements.
hello
just installed freedos
i have killer e2200
i don't have a chance to have an internet right?
You need to have a DOS driver for your network card if you want to connect to a network on real hardware. But on Intel's website, I only see a Killer E2200 driver for Windows. Maybe another driver will work?
@@freedosproject ok thanks for quick response i thought you stopped this channel,
if you are right about drivers then what is the point to still use this os? as i understand it doesn't support modern things
i am just started reading book called "viruses in ms dos" by kasperskiy and i see a lot of new stuff about pc
so is it a good idea to use freedos for observing stuff?
it will be still hard cause i will have to use my phone for surfing while booted in freedos on pc
I tried every key combination I could think of but I can't find a way to type "\" in dos editor. can anybody help me fix this issue? I'm using a French keyboard layout
You probably didn't set up your keyboard when you installed. You will need to set up KEYB to match your keyboard.
@@freedosproject the problem is that it works in dos and in fed but not in edit.