DOS Executables Explained [Byte Size] | Nostalgia Nerd
Vložit
- čas přidán 7. 09. 2024
- .COM .BAT. EXE... these are a few of my favourite things. Ahhhh MS-DOS. A beautiful command line driven operating system which filled our hearts with glee. Core to this glee filled life was file formats and the programs lurking within them. These would come with either a .com .exe or .bat extension so they could be executed by a few taps on your keyboard. But what exactly is a .com file and how does it differ from an .exe or .bat file. Come to think of it, why do I care?.... I can't answer that question, but at least I can tell you how these files differ. So here we go.
** For exclusive videos, mystery boxes and other rewards, please consider supporting me at; / nostalgianerd **
☟Sharing☟
If you wish to share this video in forums, social media, on your website, *please do so*! It helps tremendously with the channel!
☟Subcribe☟
www.youtube.co...
✊Support Me! ✊
*Patreon*: www.patreon.co...
Visit my eBay Shop: ebay.to/1QQpYyy
Buy via. my Amazon affiliate link: nnerd.me/MGOI
★Join me on Social Media★
Twitter: / nostalnerd
Face: / nostalnerd
Instagram: / nostalgianerd
Web: www.nostalgiane...
★Equipment★
Lumix G6 with Vario 14-42mm Lens
Nikon D3200 with 40mm Macro
Corel Video Studio Ultimate 2018
Corel Paint Shop Pro 2018
Blue Snowball Microphone
♜Resources♜
If you believe I have forgotten to attribute anything in this video, please let me know, so I can add the source in. It takes time to make these videos and therefore it can be easy to forget things or make a mistake.
Does anyone want to see a video about that "Menu" batch file I made?
Batch files need more love. So, yes.
Nostalgia Nerd yes please
YES!!!
defo.. :)
yes
Remember a time when "dir" listed the files so slow you could read them as they scrolled down the screen? I miss my old 286 and 386.
Nowadays you can still kinda do that if you are on a bad network connection and run ls on Linux using SSH.
@ger du I think the "p" parameter was added to the dir command quite late . Before that, "dir | more" could be used.
@@enginerd80 I don't know when exactly it was added, but MS-DOS 2.11 definitely already did have the "/p" parameter.
Btw, I am not sure what kind of PC Brad had - my first computer, an 8088-8 XT, did scroll the file names too fast for me to read if I didn't use /p - even when it was the directory of a diskette.
@@arthur_p_dent Oh... well, in that case I guess I just learned about the /p parameter late then. Or maybe there were differences between the standard MS-DOS and the variant on my first PC (IBM-DOS or PC-DOS 4.00 on 10 MHz 286 IBM PS/1). Actually, most likely I just learned the "| more" thing first, and only learned much later about the /p, and just assumed that it was a new feature in that DOS version.
@@enginerd80 most definitely the latter . I also had some bootdisks with PC-DOS 3.3 and they did have the /p and /w switch.
Most of the other switches, however, most notably the /s switch to display all subdirectories, and the switches to specify file attributes (and show hidden and system files) and sort orders, were not yet avaliable in 3.3. Not sure when exactly they came. MS-DOS 5.0 had them, but I never worked with 4.x.
My younger officemates would marvel at me when i start working on the command line in a more recent windows. They think im a master level hacker or something. Lol
"At this point batch files became irrelevant for most users" - Oh if only... Still writing batch files in 2018, as that is the lowest common denominator for Windows.
It is true though. If you write your own batch files (or Bash scripts, etc.) or even use them in 2018, you're not like _most_ users. They're tremendously useful, but really mostly to power users.
I just write today a .bat file into the Startup folder, to set the VNC server to show only the primary display (the setting resets after every reboot).
I did an install of DOS 6.22 with Windows 3.1 last week and wrote a BAT file to handle a few things...
I surprised myself remembering everything that I did.
I still make BAT files for things like rename many files at once cause there's still things that are hard to do with just Windows Explorer. Linux shell scripts are even more flexable...
All about that PowerShell script now though. AFAIK they are as capable/flexible as Linux shell scripts (relative to Windows, ofc).
By god; me and a friend during middle school would make “OSes” that were really just fancy command line GUI’s and menu systems and put them onto floppies in BATCH
Yeah, I did the same … writing huuuge menu BAT files for starting games and programs and processing user input with CHOICE and %ERRORLEVEL%. Overexaggerated that a bit though when I ended up using templating via variables and ANSI.SYS for color and cursor replacement.
The things with .com executables and the .com domain actually did confuse me back when I first got Internets. Since I was used to running and even writing .com programs, I was convinced that altavista.digital.com was a program somewhere on my computer that I never managed to find, but that I could check out how it worked and even write similar things myself. I lived with this frustration for years before I found out how DNS works.
Yeah, I remember being confused about that, too, when I first heard web-jargon (decent, affordable internet that didn't involve long distance charges didn't come to my city until 19-freaking -98), especially coming from learning how to understand FIDOnet addressing.
Many of the com files were actually executables which have the header MZ. True .COM files were limited in size and could not declare a stack. It was decided to make .COM and .EXE interchangeable in later versions of DOS. Batch files are simply text files of DOS command.
Later Norton come up with an enhanced DOS command interpreter dubbed as NDOS. This added a new kind of executable file, a BTM file. It could contain additional commands and like bash could define aliases.
Later 4DOS introduced as shareware It could feature colored text much like bash. It was NDOS on steroids. Unfortunately Windows95 wiped it out.
@@karlbergen6826 true, later versions of command.com are an example for this. E.g. the command.com of MS-DOS 7.10 (which is the base of Windows 95B to Windows 98SE) has 93,890 bytes. PS: I find it kind of funny that youtube formats command.com as a link.
Somebody needs to come up with a .exe top-level internet domain . . . .
I want to be a kid again....
.BAT files are still in use to this day, and even for their original purpose. Of course the language somewhat changed (from DOS to the new fangled NT command line) but their operation still remains the same.
Haaaa good old Dos! Stopping Windows to get enough RAM to run Doom from Dos. Thx
These days we get soo much RAM and Windows is soo efficent at managing it that I don't think we'll ever get back to things like that
Sad thing is, I don't remember having a problem running it on a 286 ... I'm pretty sure it was the 286 I was running it on, I used it for most of the 90s.
Wouldn't you would just loadhigh some things from config.sys? Do you mean you were running doom from within windows 3.1 and had to exit to dos-hell?
Ahhhhhhhh the good old days of DOS :) I learned of .bat files and went to town I made menus and even a crude password protect of my computer. Then I found a sweet program called Hard Disk Menu IV and I was in heaven. Back then I even used that program to load windows 3 as it was not like now, the PC did not boot into window but my hard disk menu.
Oh my god!!! "Dr. Sbaitso"!!! I used to play with that all the time!!! It was such a funny program! It was this computer voice psychyatrist where it would "Ask you to talk to it about your problems." and you could just type anything at all into the thing and have a conversation with it. The conversations me and my friends would force that thing into were often really hilarious. It was such a fun little gem of a program.
BlackburnBigdragon remember the SB test .mid file then?
Yep. Believe it or not, I still have that old Soudblaster setup floppy disk in my collection as well as a USB floppy drive. If the disk is still readable, I could probably still load all that stuff up in DosBox. I also still have my first computer still sitting in my computer room. I haven't turned it on in over a decade. Someday I'm going to turn it on. It might even have those programs on it. I know that the original Doom and X-Wing are on it.
The IMAGE_DOS_HEADER which contains MZ or "4D 5A" also known as IMAGE_DOS_SIGNATURE , it is still used in PE formats today which technically makes all PE files MS-DOS compatible, although you will most likely see the famous string "This program cannot be run in DOS mode." but it will execute nonetheless.
PE do contain a full (but minimalistic), complete MZ file just for that
Daniel Monteiro And you can in fact choose almost any MS-DOS EXE instead when creating the program file, but the addressing in the PE, NE, LE or LX program needs to be adjusted to the size of your DOS program, so changing it later can get quite tricky.
@@johnfrancisdoe1563 true, scandisk.exe contains a full DOS and Windows program, which is in this case used so you can really run the same executable in DOS and Windows with basically the same functionality but a very different interface. As far as I know some third party disk tools also used this trick.
Fun fact: the error message you refer to is actually displayed by the executable; in other words, DOS runs the executable, and what the executable does is print that message and exit. That's why if you open a Windows EXE in a hex or text editor, you'll see that text near the beginning. If you search online, you'll see it's actually led to some confusion for Mac users in the past, who would attempt to run a program that (unbeknownst to them) isn't compatible with Macs, and would find it opening in TextEdit. They'd see that text right away and naturally reach the conclusion that the reason it's not working is because their Mac is in "DOS mode".
"You massive nerd!" The computer: *blip*
SBAITSO !!! If you keep pestering him about what Sbaitso is he would eventually spill the beans... "Sbaitso is Sound Blaster Acting Intelligent Speach to Text Operator". What a blast.
Paul Roux Surely it’s “Text to Speech Operator”?
Pedant in training.
Yeah, that's Dr. Sbaisto, which is... like... probably not even a real doctor.
Nick Wallette oh he was. He taught me how to remove my sister's kidney.....
LordSenile noooo... Sbaitso was text to speech. Speech to text didn't really come around until the mid to late nineties with IBMs Dragon. And that was pants, I can assure you!!!
My brother in law and I spent 2 months compiling about a 30 page text document story we wrote and then got super stoned one night and let Dr Sbaitso read it out loud to us. I don't think I ever laughed that hard in my life.
Filled? - DOS still fills me with glee, especially when you have it working for you - I still use it at work, it's great for scripted FTP feeds and all that great stuff. Gotta love DOS - in fact we have a summer student right now, we're subjecting him to DOS as much as possible.
"echo off"? That's wrong! It's suppose to be "@echo off", thank you!
Technically "echo off" works too, but it will show the command. The @ stops the following command from being shown so you can use it with anything but turning the echo off stops every command from showing.
Nick Armor Which is why I said it’s supposed to be @echo off
The "@" prefix only have real effect when it was run from a .bat file,
which is to suppress the visibility of executed line if the "echo" are still on state.
So if the .bat file only have 5 or less lines, you may want prefix all the lines using the "@".
Koppa Dasao @echo off doesn't work in older MS-DOS versions, as it was a later feature enhancement.
As a kid, to me 'echo off' was some esoteric process invoked before a game began. Kind of the PC equivalent of the lights dimming and the curtains parting at the cinema before the entertainment begins :-)
It turns out that all it really meant is that the game's programmers simply forgot, or chose not to use the '@'!
Besides the 64K limit, the other main difference between .com and.exe is that the exe header includes relocation information so that the application can run anywhere in memory as opposed to a.com file that is restricted to starting at location 100h
Really looking forward to learning about exe vs msi files. I never figured out why I should download one over the other when I try to download programs on the internet
I saw the Quake installation screen! Fun fact, when the private beta version was released, I called out of school. Totally worth it.
"Not enough conventional memory." - I remember seeing that quite a lot. Games could be very picky about requiring ALL of your conventional memory even when you had lots of extended memory. Luckily dosbox seems to always give games what they need.
The second I saw the closeup of the curved side panels on the CRT, I knew that was either an Amstrad PC1512 or possibly PC1640. Most people consider those to be Europe/UK machines, but they did make their way to Canada in large-ish numbers in the late 80's. It was my job to yank the second floppy and install a Seagate or Miniscribe HD into them. (Sometimes requiring a wee bit of hand filing on the outer case to make the cover bezel fit handsomely)
Duuuuude Dr Sbaitso was life. Nice little piece of obscure nostalgia.
One interesting note is running Windows applications under DOS will error out as "This program cannot be run in DOS mode."
This text and function is still used in modern compilers today, put a random modern day Windows .EXE into a hex editor and take a look yourself.
Wow, I was talking to people about the days of DOS when I was at work yesterday!
I remember how you had to manually set the interrupt requests for your sound card for all of your games. When Windows games started doing all that stuff for me, at first I was kinda upset. But looking back now, I am so glad that changed.
Batch files are still very useful for any number of things. Case in point if you ever needed to have a list of files of a folder, its as easy as Shift+right click that folder, then type:
dir /b /s > filelist.txt
Then press enter. You now have a file called filelist.txt (in the same folder) with a list of all the files in the folder and in any sub folder (/s-Thats what this is for) You are free to call the text file any name you wish eg fils.txt, listoffiles.txt etc...
Oh and let's not forget the different size types of executeables... tiny, compact, small, medium, large, and huge. They determined where data/code fit into the memory page(s) and thankfully obsolete.
Skaarjy Actually, that wasn't a DOS feature, just 6 different styles of how to handle memory inside 16 and 32 bit x86 programs, though most 32 bit programs ended up using the tiny/flat style also used by 32 bit Windows and *n*x. x86_64 mode actually removed the CPU features needed for huge, large, medium, compact and small mode.
Bonus fact: In Windows 95/98/Me, the core GDI and USER OS modules, and many display drivers actually used mixed 16/32 bit large mode, where some pointers were actually 48 bit sector:offset addresses.
Back in the days I really thought that domain.com was just a webserver running or serving a .com executable.
I'm slightly freaked out... You wished me a good evening... How did you know I was watching this during the evening....
More than likely because he finished recording the video at that time and used said time referential in his closing. Nothing more. Hope this un-freaked you.
I wonder how many computer users today even know what a file extension is? Windows has been hiding them by default for the last, like, 20 years or something smh
I miss being able to patch game EXE files using a series of batch files or a utility. Imagine doing that nowadays! Heck, some games even told you to change around a byte or two to fix issues with OS/2 or some sort. Dunno why they didn't just use command-line arguments, but whatever formats your hard disk, I guess.
coffee115 Patching binaries is still a thing, technically, but it's usually easier to just ship a whole replacement binary, nowadays.
also, the security risks this involve is just insane, i remember excecuting randomly downloaded trainers etc, oh man, if i would do that today i cant even imagine all the adware and spyware i would get haha
Yeah... Still, did you know windows to this day contains not one, but 5 seperate batch file interpreters?
Wanna write an old-fashioned dos style batch file? That still works.
Visual basic style batch file? Yep. That's possible too.
Javascript batch file? For some reason, you can do that too.
There were more, but I forget what they were.
Also some require installing optional windows components...
But it's still kind of bizarre to realise that's there...
@raafmaat lol. Did you know Quake was banned on a lot of office networks?
Why you ask? Because strictly speaking it's a trojan.
As in it contains a backdoor that can give ID software (or I guess someone else that knows how it works) direct access to your system.
Scary huh. XD
And that's not some dodgy trainer, hacked software, warez or other pirated thing... nope.
That's Quake itself, as written by ID software...
Go figure.
The difference between malware and legit software is usually intent.
Something like Teamviewer could technically be considered a Trojan, since it gives remote access to your files, session, allows execution of code, etc.
But since it's used as a remote desktop/assistance tool, and generally doesn't hide itself well, it's not. But it does most of the same things a Trojan would do.
I am so damn glad you featured DR SBAITSO! God I had forgotten about how much fun I had making it say ridiculous stuff in like 2nd grade... good stuff dude. Really enjoy the content.
... making batch files to work between your FidoNet front-end mailer and your BBS software was always a treat ;)
I don't think younger people today understand that the x86 processor in 16-bit mode, aka "real" mode (which is what many PCs boot into by default even today) has segmented memory. This means memory is addressed in 64KB chunks, due to how the CPU registers are designed. You had a segment register and an offset register, and these were combined to create a 20-bit memory address (hence why you could never address more than 1MB). So when you ran a .COM file, this meant the program was loaded into a segment, which could be completely anonymous and irrelevant to the program, and it could happily find parts of itself in memory just via the offset. An EXE, on the other hand, was designed to be capable of addressing more memory in other segments. But since you didn't know what segment you would start in, the program was dynamically modified at runtime with that information. The EXE header contained all the locations that needed to be modified with that information.
Segmented memory was both a pain and a charming feature of the CPU. These days, once you switch the CPU into the more relevant 32 or 64-bit modes, you usually use linear addressing and none of this is a factor anymore. Segments suddenly become virtual, they can be whatever piece of memory you want pretty much, and the offset register is large enough to address much more memory within that space.
Memories of all the great times. Man, those were the days.
Totally forgot about the MZ bit...awesome video, as always!
So funny the disclaimer at the end. Was thinking earlier in the vid.. "wonder if anyone is confused and thinking.. _wait a minute, you own all those domain names - and all various folders on this piece of junk old computer?!" haha.. "Is this an editing trick?!"_ Times have changed. Great vid, as always, Thank you! :)
Pretty sure anyone who watches your videos would already know about those but thanks for the nostalgia.
Long live *.OVL.* We'll revenge!
I'm getting goose bumps. I don't think there is a cure. Nice vid, I'm feeling all nostalgic.
Oh man. this gave me flashbacks of trying to get T2: The Arcade Game to run. It took me forever to make a boot disk that had just the right amount of conventional memory, that still allowed for the Mouse and my Sound Blaster 16.
The end result? A kind of meh port, that looks about almost as bad as the Genesis version, but sounded worse! The port's one saving grace was the speed setting. It made the Truck and Police van stages somewhat fair.
Batch files strike me as the most efficient first launcher. They basicly give enough run-order and command flexability to solve individual problems or requirements. One can even create a form of GUI to solve what windows later packaged for users ahead of time. (Something I'm actually going to look up now. heh!)
The first PC i owned i made a BATCH file that any visitor had to get past as the PC started. It was a login prompt made entirely by Choice commands.
I also (since this was DOS 5.0) used a keyboard remapping program (which shipped with DOS 5.0) that disabled the C and BREAK keys so they couldn't break out of the batch.
And furthermore, once "logged in" the users had their own symlinked (again, a program that shipped with DOS 5.0) drive letter for personal documents. It was a folder on C: that was mounted as drive E: and the folder on C: was named "mother .CPU", the space in there wasn't a regular space but a non-breaking space (ALT+255) and not a single user figured it out. I even told them to figure it out and they couldn't.
I felt so smart!
Also, i of course had a BIOS password and i disabled floppy access so users couldn't boot from floppy or bring in programs that would be able to navigate to the protected folder. Such as Norton Commander.
I get the feeling that such tricks would still work today on most users.
Take a look into the specifikation of the mainboard. For to set the default values of the Bios we have to place a jumper for 3 seconds. That erase the password too.
And maybe sombody access the floppy controller with the port adresses hex 370 - 377 and enable the floppy without using the bios.
Pulling apart the computer wouldn't be stealthy enough to allow them access like that considering i was in the same room.
Using hacks is possible but so would knowing the ALT+255 trick. In fact, it's more likely they would know the existence of NBSP than them knowing how to hack a floppy into working after it's been disabled in BIOS.
Thank you for your insight though.
Regarding bat files running last, behind com and exe, you could always just have the com file exclusively launch a .bat and then self terminate...
i understood nothing about computers until my mother bought me a book all about MS-DOS 5.0, then i understood basically everything.
the early 90's was truly a different time.
I started with DOS 3.3 For Dummies. Because my mother called me up, said she'd bought a computer, and I should come help her get it running, because I'd had a Vic-20 a few years before, so of course I should know what to do with a Tandy 286. Computer courses were just starting to be a thing when I LEFT high school, and you had to be crazy good at math to even be considered to be allowed to take it. And the first course my school offered was taught by the phys ed teacher, and all he knew how to do was make us play a space invaders tournament ...
Oh man! Thanks for this. I really never knew the run order of these three great filetypes. Your videos are awesome
Run order was a security thing. If you could drop a .bat file in a directory, then you could have it execute something unintended. It gets even more complicated when you consider %PATH%. While I agree, it might have been more convenient to allow Batch files to do extra work as a substitute, it was intentional that it wasn't. You could always add the extension to the command when running it to be very specific about what you're loading.
God that brings back memories. You should do something on DoS Shell as well. It was awesome !. Who needed windows when you had Dos Shell.
XTree Gold ROCKED!
Who doesn't love the command line? Even now I do all my productive work on the command line and really only use a GUI for games or web browsing
Subscribed!!! because of the nostalgia you brought to your channel
COM-file meant COre iMage also. As it was just load and run.
Don't forget about the self-bootstrapping games. You had to reboot your machine with a disk in the A: drive to run those!
Big Red Racing! Lots of memories! Not so good memories, but still memories.
Have to admit I didn't know the technical reasons for having both com and exe files. Bat files are still around though as login scripts, scheduled tasks etc. . Our IT environment is held together by bat files and duct tape.
I remember as a kiddo on our Windows 95 PC seeing those cogs in the icon of the .bat files and thinking it was really cool because they reminded me of the cogs in some of the levels of Super Mario 2: 6 Golden Coins on my GameBoy lol.
Just to mention, the opening a .COM file with DEBUG.EXE we have the assembly of the .COM file ... And also build some small .COM programs aswell, like calling the ST11 ROM to format the ancients hard drives "physically".
It's weird. The challenge of working out how to run a program/game used to be half the challenge. I've got a mate who says - 'How come you have this amazing PC but try to turn it into something ancient?' Can't explain but to me it was 'half' the fun !!!
Batch got me into programming. It needs more love
1:20 BIG RED RACING, HOLY CRAP! I remember having a shareware copy of this game as a kid and playing the heck out of it. Nostalgia bomb!
I still use batch files to automate various repetitive tasks.
One topic I would really like to see a video on is why variable handling in MS batch files is such a mess. You use one form to define the variable, but another form when referencing its value. Still other variables have special characters you have to use, or no special characters at all. And when you try to use variables in a loop, their handling completely changes, complete with an all new set of special characters to use.
Frankly, I think the MS programmers were baked out of their skulls when they designed the batch programming language as it runs counter to all common sense and really has no internal consistency. Every time I write a script using variables, I spend more time trying to figure out what arcane variable rule I broke than testing the rest of the commands. I still don't have the faintest clue why the value of the errorlevel variable needs to be tested in descending order after the choice command, or why you can't simply test for a value of 1 or 0 after another command to see if it was successful. If it has a value, why can't you test for that specific value? Of course what do you expect from a company that removed the choice command from XP, ensuring that a ton of scripts would break on that version of WIndows?
I didn't know about the memory restriction for COM files. I picked up a book that taught assembly and the beginning lessons taught how to make COM files using the DEBUG command. So I made quite a few little assembly apps using that before switching to MSASM or whatever assembler was suggested at the time by the book I followed. I still only really know the basic 80x86 instructions and I don't remember their hex values.
I had a boot disk that I created designed to use as little memory as possible so I could run games. The good old days
Who else remembers playing DOS games at 60hz refresh until it felt like your eyes were bleeding :)
I remembered feeling really smug years ago because I found a .bat to .com converter and was distributing stuff to my friends and asking them to run the .com file thinking it looked more professional.
Not to forget that .bat files are still in use today for simple scripts. I use several today which are started using the scheduled tasks inside Windows 10 even :)
Who misses DOS?
Robeight i miss it
I miss it in that there was only so much that could go wrong. A lot of cryptic stuff, yes, but cryptic stuff I _knew_. Nowadays you almost need a certification just to get a competent look in.
I use it almost every day.
I don't miss it because I still use it.
Nope, I love android.
Anyone who dismisses the power of a batch file clearly never knew the power of them in the first place.
My dad wrote these so 3 year old me could play all my shareware games. Was so sad when XP killed all my DOS games. Then dosbox arrive and the nostalgia could continue!
I remember making an extremely long and convoluted autoexec.bat back in the day, with various balances of expanded, extended and convench (as we called it) memory!!
Used nice colours and some flashing text....and of course, the ever-present battle to see just how much you could load with himem.sys to try to crack the 630k of free base ram barrier!! Don't think it ever happened though, himem and emm386.....oh how I loved you so!!!!
My favorite game was editing command.com and changing the way extensions are processed, for example swapping exe and bat
Like many others here, I still use batch files to perform support tasks in modern windows implentations. Just so much easier than Powershell to do some pretty basic but automatable tasks. It winds me up so much watching younger and offshore collegues struggling with scripts, or ploughing through a GUI when a little two line FOR /F would suffice
MS DOS might be outdated but I remember seeing a number of retailers use it for their electronic point of sale machines.
Jack Kraken: Still has its place for simple automation tasks.
Not that you want to do it, but I bet the Apollo Navigation Computer can still get you to the Moon and back
Thank you for make me feel very very old after watching this video. Been there done that.. :(
Run-order made for a neat way of running "virus". Have a hidden file with extension COM, that would run when you supposedly wanted to run the real program, the EXE. So the COM would do its dark deeds and then run the EXE. Inspection of the EXE would reveal no tampering whatsoever. Of course it did not last for long. EXE files did have a checksum somewhere biut I only recall one program actually testing this. That program was our hero! The BASIC runtime (compiled BASIC).
I really kind of miss those days.
I expected something more complicated, like the structure of .exe files and how they worked. This video is something Gameranx would come up with, honestly.
Don't underestimate your audience, please. We are all nerds here after all, right?
Also, could you please make a video about Windows executables? They all had a header that displayed error message when user tried to run them in DOS, yet worked fine in Windows.
oh i LOVE batch files. i discovered them when i was 13 and it got me into scripting and programming
Do ELF next! :)
The PE/Portable Executable format wasn't mentioned either, as far as I could tell.
I second this. I've written way too much C code to understand as little as I do about how executable code is loaded into memory and run. Teach me, Nostalgic Nerd.
TSR / ELF / PE I love acronyms
That MZ signature is still present in every PE file on Windows. In fact, it is part of a DOS stub that just prints "This executable cannor be run in DOS.". Except for regedit.exe on Windows 95 and 98, in which their DOS part contains Windows registry repair commands instead of a sad take on "Hello world".
As for ELF, it might still be a little bit too recent for this channel. Linux used another executable format before ELF (never used it myself, as I first used Linux in 2001, when ELF was everywhere) for there is a kernel config option for it (well there was one for Linux 4.2, but heck, I have not booted with Linux PC for over a year)
Or maybe a.out
My operating system is much different than the mainstream. My main entry function(s) do a little bit more work than passing char argument arrays and setting up various things for the standard `int main(int, char**)` prototype, which is defined as `Return main(ArgList**);` or `int main(ArgList**);` or even `int64_t main(ArgList**);`. Since I like the unix version of `Collect, Process, Output` so much, users can direct multiple programs (or files themselves) to feed in data as either a dynamic or const buffer, which is stored in memory differently, or a data stream. This means my program can collect the data it needs (think makefile targets after the colon) by the user before the processing begins, verifying arguments and validating supplied 'targets'. This improves caching by the OS. My executable accounts for this by checking for a symbol to be present to do this, much like how DllMain acts differently from the main in windows. The user can set up the information without having to open files, malloc buffers themselves, worry about handling all possible cases of FNF/OOM, yada yada. They can even release the data if they no longer need it during any of the phases, otherwise the operating system cleans it up on exit of the function if needbe. The function looks like `void Collect(FileList**, ArgList**);` `void Process(DataList**);` `Return Output(ProcData**);`. The collection process is responsible to parsing the data entered into it and making sure its applicable to use, meaning getting it into suitable form for processing. The processing stage does the work with collected data, such as converting bmp to raw. The output then writes to the destination file and ensures validity. A typical program can look like this. pastebin.com/L7WvqyRU
2:51 No, .com files were not loaded at or to "a fixed address". Actually, the opposite was true: they could be loaded to virtually any address. Well, the address had to start at the multiple or 16, but that was really the only limitation in that regard. This (ie. that they could be loaded at any address) was the very reason why their size was not allowed to exceed 64K - because they had to fit in a single 64K segment of the x86, and could only use segment-relative (ie. near) jumps and data accesses within that segment.
If they'd have been larger than 64K, they'd have needed far jumps and far data addresses, which then in turn would have to be adjusted after they have been loaded into the memory, based on the actual address they have been loaded to. But since the .com format (as opposed to the .exe format) offered no place for marking up the places where addresses were to be adjusted, .com files couldn't be longer than 64KBs.
@Gabor "This (ie. that they could be loaded at any address) was the very reason why their size was not allowed to exceed 64K - because they had to fit in a single 64K segment of the x86, and could only use segment-relative (ie. near) jumps and data accesses within that segment."
We can use far jumps and far calls within a *.com executable and we can get more free Ram from DOS for our data and we can change our data segment register to any segment address within the first mb.
next time: explain ELF file headers in Linux systems :)
www.skyfree.org/linux/references/ELF_Format.pdf
Clockon! I use that on my DOS machine as well, I recognised the startup chime at 2:10.
A bit of in-depth information;
EXE files are actually called "portable executables". There are other executable file formats like the ELF on Linux, or the APP file format of the GEM environment.
COM files nowadays aren't always in the original COM format, either. If you see a COM file larger than 64k, that means it's just a renamed EXE file.
MSI files, on the other hand, are not actually executables. They are CAB archives with instructions attached to them that Windows just knows how to open by default.
.CAB stands for Cabinet file, right? I'm not too sure anymore... I got to know MSIs as typical Windows installer packages (MicroSoft Installer package)
Yes, a CAB file is a Cabinet file. It's actually an older format and Microsoft uses zip files for their more modern file formats (like docx, xlsx, etc).
I believe .msi files are run with the Windows Installer application.
Nick Armor Nope. PE or "Portable Executable" is the COFF-derived Win32 EXE/DLL format that is usually piggybacked on an MS-DOS EXE file, just like the older NE (New Executable) format mentioned in the video.
MSI files are actually COM structured storage (a kind of filesystem-in-a-file) containing a multi-file relational database of install instructions stored in internal streams and optionally one or more CAB format internal streams containing the files to install. There can also be extra streams containing code and pictures used during install and uninstall.
Sure, but the EXE files we have today are still portable executables. I didn't know MSI files used structured storage, though.
Fun fact: put a single @ in a file, rename it as .exe and run it. DOS will reboot. I discovered it when I wanted to see if you could just rename a .bat file as .exe and still run it :D
I manage a fleet of 500+ ATMs and still use batch files for administration every day.
Extenders... Ahhhh, the good ol DOS4GW era
Oh, yes, yes I remember making my boot menu of DOS, after that win 95, and last one I made was a massive menu for win 98 that have tools and so on , I think I even got the Dosshel in it, and the 98 one I had the partition magic and some others
Good video
Ah this brings me back to my first pc. No manual. Just dos and a pile of floppy disk. The big 5" suckers. It took me all day and then finding a floppy with a sticker that said how to access the floppy drive. I was playing Jill of the Jungle minutes later. Good times.
omfg!!!!! Is that an Amstrad PC1512?!?!?!? That was my 1st PC!!!!!!! We won it in a radio competition, I think I was maybe 6 or 7 years old. We eventually upgraded it to 640k RAM(!!!!!!) and got a 10Mb HDD (external) that was the size of, and probably heavier than, several house bricks. Ahhhhhh, those were the days.......
I love your videos. Proper nostalgia bombs everytime.
Keep it up man ✌️
During some free time I had in my networking class in high school I was able to successfully install windows 95 in a virtual machine and I probably got way more excited about that than I should of. The whole reason why I did that was to play OG Minesweeper btw.
Awwww the good old dos days, I knew dos before I could fully read
Spent many hours playing with Dr. Sbaitso in 1992-93.
On the Apple-II we had 4 executable types : I, B, T and A. That obviously makes the Apple-II 33% better than the PC :)
And in CP/M-86 they went from COM to CMD to save mix ups and so you'd know which it was for
I was also a pro at writing .bat files back in the day, but if a game came with a .bat file, I would purposely avoid it and run the .exe instead. Those .bat files included with games were often sloppily made and pointless when you could just run the .exe. Sometimes they were made by a third party, like whoever distributed the shareware version, so they often weren't even 'official' files from the game creator.
Top job mate!!! And yes, the difference between .com and .exe HAS been nagging me for years!!! One of those things I never Googled though. Thanks 😁😁
Such a lovely piece of nostalgia.
Talking about batch files reminded me of when my mom kept doing something that would delete the autoexec.bat file and I had to keep rebuilding it.
" .com stands for command"
Commercials: am i joke to you?
Came here thinking it would be an explanation of DOS executable file format. Oh well.
Ahh it did go a bit into it... ;-) Thanks for the video.