How I write programs on FreeDOS

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ธ.ค. 2024

ความคิดเห็น • 84

  • @Snufflegrunt
    @Snufflegrunt ปีที่แล้ว +20

    I adore DOS still being used, for “real work” or fun, it’s still great.

  • @ahmad-murery
    @ahmad-murery ปีที่แล้ว +8

    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,

    • @freedosproject
      @freedosproject  ปีที่แล้ว +3

      Glad you liked it!

    • @OpenGL4ever
      @OpenGL4ever ปีที่แล้ว

      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.

  • @Learnerofthings
    @Learnerofthings 10 วันที่ผ่านมา

    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
      @freedosproject  6 วันที่ผ่านมา

      Glad you like it! We have lots of great C compilers in FreeDOS, too.

  • @martinhardy7659
    @martinhardy7659 ปีที่แล้ว +3

    Wow 😳😲 a package mgr for DOS. Incredible!

    • @freedosproject
      @freedosproject  ปีที่แล้ว +2

      Jerome did a great job with FDIMPLES ☺

    • @OpenGL4ever
      @OpenGL4ever ปีที่แล้ว

      @@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.

  • @noisepuppet
    @noisepuppet ปีที่แล้ว +1

    They can take our lives, but they will never take... OUR FreeDOS!!

  • @joepike1972
    @joepike1972 ปีที่แล้ว +4

    That was brief and useful. Thank you for sharing it.

    • @freedosproject
      @freedosproject  ปีที่แล้ว

      Glad it was helpful! Some folks have asked about it, so I figured I should finally do a video about it.

  • @CasperLabuschagne
    @CasperLabuschagne ปีที่แล้ว +1

    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.

  • @wherami
    @wherami ปีที่แล้ว +1

    Ability to write c on this is essential for today

    • @freedosproject
      @freedosproject  ปีที่แล้ว +1

      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.

    • @axle.student
      @axle.student ปีที่แล้ว

      @@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.

  • @bigbrothertw
    @bigbrothertw ปีที่แล้ว

    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

    • @freedosproject
      @freedosproject  ปีที่แล้ว +3

      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.

    • @chastitywhiterose
      @chastitywhiterose ปีที่แล้ว

      @@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.

    • @axle.student
      @axle.student ปีที่แล้ว

      @@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

  • @cynical5062
    @cynical5062 ปีที่แล้ว +5

    Interesting!

  • @maxmuster7003
    @maxmuster7003 ปีที่แล้ว +1

    We can put tiny batch files in the path directory to start applications (using drive and folder) that are not in the path.

    • @freedosproject
      @freedosproject  ปีที่แล้ว +1

      Yes, that works too!

    • @szenti707
      @szenti707 ปีที่แล้ว +1

      That's my way in MS-DOS. I created them in a folder C:\BIN, analogue to unix/linux.

    • @axle.student
      @axle.student ปีที่แล้ว +1

      I just place all my APP launch batch files in \FREEDOS\LINKS as it is already in the path.

  • @thisisreallyme3130
    @thisisreallyme3130 ปีที่แล้ว +8

    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?

    • @freedosproject
      @freedosproject  ปีที่แล้ว +3

      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.

    • @OpenGL4ever
      @OpenGL4ever ปีที่แล้ว

      @@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.

  • @ericorilla3316
    @ericorilla3316 ปีที่แล้ว +2

    nice to see that c: prompt back again, can we run those turbo c, turbo basic, turbo pascal in freedos?

    • @judgegroovyman
      @judgegroovyman ปีที่แล้ว +2

      I ran turbo c in it last year quite a bit

    • @freedosproject
      @freedosproject  ปีที่แล้ว +4

      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.

    • @OpenGL4ever
      @OpenGL4ever ปีที่แล้ว +2

      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.

    • @ericorilla3316
      @ericorilla3316 ปีที่แล้ว

      Love to write TSRs during dos era, in a way, if properly disigned, u can simulate muti tasking by hooking timer interrupt

  • @potzko2552
    @potzko2552 ปีที่แล้ว +3

    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 :)

    • @freedosproject
      @freedosproject  ปีที่แล้ว +2

      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;
      }

    • @potzko2552
      @potzko2552 ปีที่แล้ว

      @@freedosproject this is exactly what I was looking for, thanks a lot :)

  • @Thatguyplayvr
    @Thatguyplayvr ปีที่แล้ว

    I have a 4GB USB with FreeDOS and I enjoy using it!

  • @adancalderon8915
    @adancalderon8915 ปีที่แล้ว +2

    Very Cool

  • @KhalidThwiny
    @KhalidThwiny ปีที่แล้ว

    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

    • @freedosproject
      @freedosproject  ปีที่แล้ว

      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

  • @AlguienMas555
    @AlguienMas555 ปีที่แล้ว +2

    Good video

  • @maxmuster7003
    @maxmuster7003 ปีที่แล้ว

    I like to use debug for programming tiny DOS executable and i put all instructions into batch files.

  • @axle.student
    @axle.student ปีที่แล้ว

    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 :)

    • @freedosproject
      @freedosproject  ปีที่แล้ว

      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. ☺

  • @gscheben123
    @gscheben123 ปีที่แล้ว +3

    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.

    • @bitslasher89
      @bitslasher89 ปีที่แล้ว

      🤣

    • @OpenGL4ever
      @OpenGL4ever ปีที่แล้ว +3

      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.

    • @maxmuster7003
      @maxmuster7003 ปีที่แล้ว

      mphello.s file from the University of San Francisco

    • @maxmuster7003
      @maxmuster7003 ปีที่แล้ว

      ​@@OpenGL4ever But a DOS application can startup all cores.

    • @OpenGL4ever
      @OpenGL4ever ปีที่แล้ว +1

      @@maxmuster7003 That's what i said.

  • @eternaldoorman5228
    @eternaldoorman5228 ปีที่แล้ว

    Have you also done a video showing how you do these videos? They're really good.

    • @freedosproject
      @freedosproject  ปีที่แล้ว

      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

  • @macsnafu
    @macsnafu 5 หลายเดือนก่อน

    Does QuickBasic 4.5 run in FreeDOS?

  • @alexloktionoff6833
    @alexloktionoff6833 11 หลายเดือนก่อน

    What C compiler do you prefer for FreeDOS? What compiler you'd recommend for 386SX: TC, WC, DJGPP or else?

    • @freedosproject
      @freedosproject  11 หลายเดือนก่อน +1

      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.

    • @alexloktionoff6833
      @alexloktionoff6833 11 หลายเดือนก่อน

      What CPU is in your developent PC?@@freedosproject

  • @KJ7JHN
    @KJ7JHN ปีที่แล้ว

    When will FreeDOS be available on a ROM chip? I hope oh so very soon.

  • @jsariv2707
    @jsariv2707 ปีที่แล้ว

    Thanks for sharing, I love the C language, that this system lets me do this, I love it, greetings from Mexico.☺

  • @Teofilo750
    @Teofilo750 10 หลายเดือนก่อน

    I have installed freedos on virtualbox, but how do I get this screen out where you select the packages to install?

    • @freedosproject
      @freedosproject  10 หลายเดือนก่อน +1

      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.

  • @maxmuster7003
    @maxmuster7003 ปีที่แล้ว

    Is there a fix memory location for the enviroment variables, or is the memory location changing on driver loading, stacks and buffer size?

    • @freedosproject
      @freedosproject  ปีที่แล้ว +1

      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.

    • @maxmuster7003
      @maxmuster7003 ปีที่แล้ว

      @@freedosproject Now i understand, thank you.

  • @djsbriscoe
    @djsbriscoe 4 หลายเดือนก่อน

    You mentioned an emulator that you are running FreeDOS on. Which one is it? Thanks.

    • @freedosproject
      @freedosproject  3 หลายเดือนก่อน

      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

  • @Teofilo750
    @Teofilo750 10 หลายเดือนก่อน

    How are braces made?

  • @alexloktionoff6833
    @alexloktionoff6833 11 หลายเดือนก่อน

    CAn you make a video about writing hello-world driver for DOS that could be loaded in config.sys?

    • @freedosproject
      @freedosproject  11 หลายเดือนก่อน

      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.]

    • @alexloktionoff6833
      @alexloktionoff6833 11 หลายเดือนก่อน

      It's a pity, writing a driver for DOS was my childhood dream. Might you know is there any documentation to read?@@freedosproject

  • @deltakid0
    @deltakid0 7 หลายเดือนก่อน

    How do you do debugging?

    • @freedosproject
      @freedosproject  7 หลายเดือนก่อน +1

      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.

  • @lesorubshayan
    @lesorubshayan 6 หลายเดือนก่อน

    hello
    just installed freedos
    i have killer e2200
    i don't have a chance to have an internet right?

    • @freedosproject
      @freedosproject  6 หลายเดือนก่อน

      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?

    • @lesorubshayan
      @lesorubshayan 6 หลายเดือนก่อน

      @@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

  • @Sam-xq9te
    @Sam-xq9te 5 หลายเดือนก่อน

    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

    • @freedosproject
      @freedosproject  5 หลายเดือนก่อน +1

      You probably didn't set up your keyboard when you installed. You will need to set up KEYB to match your keyboard.

    • @Sam-xq9te
      @Sam-xq9te 5 หลายเดือนก่อน

      @@freedosproject the problem is that it works in dos and in fed but not in edit.