• Learning to code for MS-DOS/FreeDOS

    From Arelor@80:61/0 to All on Sun Jun 28 09:48:42 2020
    Hello!I recenlty ran into an article about FreeDOS in Linux Magazine. I already
    knew of FreeDOS's existence but the article made me curious so I did some research.I wonder if there is any recommended starting point if you want to get
    started developping programs or incorporating device drivers to FreeDOS. Most of my coding experience is with interpretated languages, but I have done some C/Cpp. I have also done some toy Hellow-Wordlesque programs in "Wintel" Assembly.Any good resource for getting started coding simple stuff in order to get a grasp of what developing for MS-DOS was like back in the day?

    ===
    Synchronet Havens BBS havens.synchro.net:23
    --- SBBSecho 3.10-Linux
    * Origin: Freeway BBS Bendigo,Australia freeway.apana.org.au (80:61/0)
  • From Dennisk@80:774/36 to Arelor on Tue Jun 30 22:51:00 2020
    Arelor wrote to All <=-

    Hello!I recenlty ran into an article about FreeDOS in Linux Magazine. I already
    knew of FreeDOS's existence but the article made me curious so I did
    some research.I wonder if there is any recommended starting point if
    you want to get
    started developping programs or incorporating device drivers to
    FreeDOS. Most of my coding experience is with interpretated languages,
    but I have done some C/Cpp. I have also done some toy Hellow-Wordlesque programs in "Wintel" Assembly.Any good resource for getting started
    coding simple stuff in order to get a grasp of what developing for
    MS-DOS was like back in the day?

    Depends on the language you want to use. You will probably want to use C, and maybe Assembler if you want to write low level code, in which case, you need a C compiler and an assember. I would recommend for DOS Open Watcom available at http://openwatcom.org. There are other free compilers, DJGPP which is for 32 bit development and there is a freeware version of Turbo C.

    I installed Open Watcom on a 486 just last week. It also has an assembler, but I would probably use NASM or FASM. Microsoft Assembler was used back in the day, and I think there is a free version you can use, albeit stripped from the full featured suite it was then, but NASM or FASM is better to use now.

    As to documentation, you can either pick up a good second hand book for programming from the DOS era (if you can find one), or look online. If writing in C or C++, then its not that different to writing code for Linux, except for the different toolchain and libraries. I learned C using Turbo C, and just going through the help files included and piecing together how the language worked from that.

    If you want to try assembly, look for the online book "The Art of Assembly". Not only does it cover assembly language, but also MS-DOS, PC Graphics, the BIOS, etc. Quite comprehensive.

    ... MultiMail, the new multi-platform, multi-format offline reader!
    --- MultiMail/Linux v0.52
    * Origin: The Dungeon BBS Canberra, Australia. (80:774/36)
  • From Arelor@80:61/0 to Dennisk on Wed Jul 1 04:50:52 2020
    Re: Learning to code for MS-D
    By: Dennisk to Arelor on Tue Jun 30 2020 10:51 pm

    Depends on the language you want to use. You will probably want to use C,
    and De> maybe Assembler if you want to write low level code, in which case, you
    need a De> C compiler and an assember. I would recommend for DOS Open Watcom available at De> http://openwatcom.org. There are other free compilers, DJGPP which is for 32 De> bit development and there is a freeware version of Turbo C.
    I installed Open Watcom on a 486 just last week. It also has an assembler,
    but De> I would probably use NASM or FASM. Microsoft Assembler was used back in the De> day, and I think there is a free version you can use, albeit stripped from the De> full featured suite it was then, but NASM or FASM is better to use now. De> As to documentation, you can either pick up a good second hand book for De> programming from the DOS era (if you can find one), or
    look online. If writing De> in C or C++, then its not that different to writing code for Linux, except for De> the different toolchain and libraries. I
    learned C using Turbo C, and just De> going through the help files included and piecing together how the language De> worked from that. De> If you want to try assembly, look for the online book "The Art of Assembly". De> Not only does it cover assembly language, but also MS-DOS, PC Graphics, the De> BIOS, etc. Quite comprehensive. De> ... MultiMail, the new multi-platform, multi-format offline reader!Thanks for the tips. Knowing which compiler to choose among is a good first step.I have noticed a lot of DOS stuff was done in
    assembly, which is a bit stricking since you mostly see high-level languages these days, heh.I will have a look at The Art of Assembly. It looks like a good
    thing to have around. I am a bit more of a C dude ad that is not saying much, though.

    ===
    Synchronet Havens BBS havens.synchro.net:23
    --- SBBSecho 3.10-Linux
    * Origin: Freeway BBS Bendigo,Australia freeway.apana.org.au (80:61/0)
  • From Dennisk to Arelor on Thu Jul 2 20:42:00 2020
    Arelor wrote to Dennisk <=-

    Re: Learning to code for MS-D
    By: Dennisk to Arelor on Tue Jun 30 2020 10:51 pm

    Depends on the language you want to use. You will probably want to use C,
    and De> maybe Assembler if you want to write low level code, in which case, you
    need a De> C compiler and an assember. I would recommend for DOS Open Watcom available at De> http://openwatcom.org. There are other free compilers, DJGPP which is for 32 De> bit development and there is a freeware version of Turbo C.
    I installed Open Watcom on a 486 just last week. It also has an assembler,
    but De> I would probably use NASM or FASM. Microsoft Assembler was
    used back in the De> day, and I think there is a free version you can
    use, albeit stripped from the De> full featured suite it was then, but NASM or FASM is better to use now. De> As to documentation, you can
    either pick up a good second hand book for De> programming from the DOS era (if you can find one), or
    look online. If writing De> in C or C++, then its not that different
    to writing code for Linux, except for De> the different toolchain and libraries. I
    learned C using Turbo C, and just De> going through the help files included and piecing together how the language De> worked from that.
    If you want to try assembly, look for the online book "The Art of
    Assembly".
    De> Not only
    does it cover assembly language, but also MS-DOS, PC Graphics, the De> BIOS, etc. Quite comprehensive. De> ... MultiMail, the new
    multi-platform, multi-format offline reader!Thanks for the tips.
    Knowing which compiler to choose among is a good first step.I have
    noticed a lot of DOS stuff was done in
    assembly, which is a bit stricking since you mostly see high-level languages these days, heh.I will have a look at The Art of Assembly. It looks like a good
    thing to have around. I am a bit more of a C dude ad that is not
    saying much, though.


    The Art of Assembler is good, but the version I've seen uses the HLA assembly language, a high level layer on top of assembly which I haven't seen used much.
    There are many other guides. Assembler was mostly used due to the limitations of the CPU, and the fact that compilers didn't optimise as well back then as they can now.

    Watcom was a popular compiler back in the 90s. It is the compiler that iD software used for Doom, so you know it must be pretty decent! Open Watcom is a current version, and it produces reasonable quality executables, so you shouldn't need to use assembler for speed unless you are targetting some really old machines, or really are streching what the CPU can do.

    But as I mentioned, DJGPP is another good one, and it comes with an IDE too, RHIDE. DJGPP is more up to date than Watcom with regards to the C++ standards it supports, but it also takes up more disk space, and needs more RAM and CPU to compile. I couldn't run it on my 486 with 16M of RAM, as it ran out of RAM.


    ... MultiMail, the new multi-platform, multi-format offline reader!
    --- MultiMail/Linux v0.52
  • From NuSkooler@80:774/20 to Arelor on Fri Jul 3 12:08:44 2020

    Arelor around Sunday, June 28th...
    Hello!I recenlty ran into an article about FreeDOS in Linux Magazine. I already knew of FreeDOS's existence but the article made me curious so I did some research.I wonder if there is any recommended starting point if you want to get started developping programs or incorporating device drivers to FreeDOS. Most of my coding experience is with interpretated languages, but I have done some C/Cpp. I have also done some toy Hellow-Wordlesque programs in "Wintel" Assembly.Any good resource for getting started coding simple stuff in order to get a grasp of what developing for MS-DOS was like back in the day?

    A lot of the coding I did back in the day in DOS was with Turbo Pascal. Look for the SWAG archive, etc. You can incorporate ASM very easily inline with your
    Pascal code very easily as well.

    A while back I create a small utility for 8086 machines using the modern Free Pascal Compiler. Developed and compiled from a modern Linux machine but FPC has
    a nice cross compile toolchain for older machines/DOS.

    If you wanna go even more modern-retro, people have had success using Rust to create DOS binaries :) If you want to go older, Turbo C is also a good option, or more limited Quick Basic (look at the stuff that is created in the DOS competitions every year!)





    --
    NuSkooler
    Xibalba BBS @ xibalba.l33t.codes / 44510(telnet) 44511(ssh)
    ENiGMA 1/2 BBS WHQ | Phenom | 67 | iMPURE | ACiDic
    --- ENiGMA 1/2 v0.0.12-beta (linux; x64; 12.13.1)
    * Origin: Xibalba -+- xibalba.l33t.codes:44510 (80:774/20)
  • From Arelor@80:61/0 to NuSkooler on Sat Jul 4 09:15:45 2020
    Re: RE: Learning to code for MS-DOS/FreeDOS
    By: NuSkooler to Arelor on Fri Jul 03 2020 12:08 pm

    If you wanna go even more modern-retro, people have had success using Rust
    to Nu> create DOS binaries :) If you want to go older, Turbo C is also a good option, Nu> or more limited Quick Basic (look at the stuff that is created in the DOS Nu> competitions every year!)Don't they take your Retrocomputing license for using Rust or something? :-PI was not aware there were DOS competitions anywhere. I will have to look those out.I think I'd rather work with a language that has modern day applications for the most part. Life has been sucking a bit for me so I am not having as much time as I want for learning a language that has only retro applications.

    ===
    Synchronet Havens BBS havens.synchro.net:23
    --- SBBSecho 3.10-Linux
    * Origin: Freeway BBS Bendigo,Australia freeway.apana.org.au (80:61/0)
  • From Dennisk to Arelor on Sun Jul 5 11:27:00 2020
    Arelor wrote to NuSkooler <=-

    Re: RE: Learning to code for MS-DOS/FreeDOS
    By: NuSkooler to Arelor on Fri Jul 03 2020 12:08 pm

    If you wanna go even more modern-retro, people have had success using Rust
    to Nu> create DOS binaries :) If you want to go older, Turbo C is also
    a good option, Nu> or more limited Quick Basic (look at the stuff that
    is created in the DOS Nu> competitions every year!)Don't they take your Retrocomputing license for using Rust or something? :-PI was not aware there were DOS competitions anywhere. I will have to look those out.I think I'd rather work with a language that has modern day applications
    for the most part. Life has been sucking a bit for me so I am not
    having as much time as I want for learning a language that has only
    retro applications.

    Is Rust for DOS efficient? I tried it briefly for Linux, and it created very large libraries. I'm not even sure there is a DOS compiler, you would have to compile on an other OS and transfer it to DOS.

    ... MultiMail, the new multi-platform, multi-format offline reader!
    --- MultiMail/Linux v0.52
  • From NuSkooler@80:774/20 to Dennisk on Sun Jul 5 12:52:54 2020

    On Saturday, July 4th Dennisk said...
    Is Rust for DOS efficient? I tried it briefly for Linux, and it created very large libraries. I'm not even sure there is a DOS compiler, you would have to compile on an other OS and transfer it to DOS.

    I've not had this issue with Rust, probably lib(s) you brought in? Yeah, you have to cross compile to produce DOS binaries. This is certainly something more
    bleeding edge. FPC is better suited if you want to produce DOS binaries from a
    cross compile and have better support I imagine.




    --
    NuSkooler
    Xibalba BBS @ xibalba.l33t.codes / 44510(telnet) 44511(ssh)
    ENiGMA 1/2 BBS WHQ | Phenom | 67 | iMPURE | ACiDic
    --- ENiGMA 1/2 v0.0.12-beta (linux; x64; 12.13.1)
    * Origin: Xibalba -+- xibalba.l33t.codes:44510 (80:774/20)
  • From Dennisk@80:774/36 to NuSkooler on Mon Jul 6 21:55:00 2020
    NuSkooler wrote to Dennisk <=-


    On Saturday, July 4th Dennisk said...
    Is Rust for DOS efficient? I tried it briefly for Linux, and it created very large libraries. I'm not even sure there is a DOS compiler, you would have to compile on an other OS and transfer it to DOS.

    I've not had this issue with Rust, probably lib(s) you brought in?
    Yeah, you have to cross compile to produce DOS binaries. This is
    certainly something more
    bleeding edge. FPC is better suited if you want to produce DOS
    binaries from a
    cross compile and have better support I imagine.

    Possibly it was libraries. Maybe it was defaulting to static linking. I remember trying some switches, but couldn't get it much smaller.

    Might play with Rust again, but I can't see much other reason to use it other than the borrow checker. D seems to offer more as a general purpose programming language which can be used as the "next C++". It just doesn't hav DOS support though.

    --- MultiMail/Linux v0.52
    * Origin: The Dungeon BBS Canberra, Australia. (80:774/36)