this post was submitted on 17 Mar 2026
26 points (86.1% liked)

retrocomputing

6233 readers
4 users here now

Discussions on vintage and retrocomputing

founded 2 years ago
MODERATORS
 

An implementation of sudo for DOS, to run the given command with full privileges. It can be used to edit important system files, run disk partitioning tools, and so on!

top 6 comments
sorted by: hot top controversial new old
[–] Luci@lemmy.ca 9 points 2 weeks ago (4 children)

But DOS is a single user mode OS?????

[–] over_clox@lemmy.world 5 points 2 weeks ago* (last edited 2 weeks ago)

If I'm understanding this correctly, it works for protected mode DOS, as in the DOS that Windows 95 and 98 run on top of.

In this case, this implementation of SUDO drops the CPU out of protected mode and runs whatever command in real mode, which is 16 bit 8086 compatible and limited to 1MB of RAM.

Unless I'm missing something here anyways..

[–] RedSnt@feddit.dk 3 points 2 weeks ago

Sure, but anyone can sit at that computer. Talking from experience as the kid that used my parents computer running DOS, I could freely edit config.sys and autoexec.bat to the annoyance of my parents.
With SUDO for DOS I can imagine only those authorized will be able to edit important system files.
I don't imagine many people are running DOS on the family computer anymore, but still useful.

[–] sjmulder 2 points 2 weeks ago (1 children)

That's true! Since there is no privilege separation in DOS, it needs to do no elevation so it can just execute the command directly. But should a future version of DOS implement unprivileged users or age verification, SUDO can be extended to support it.

[–] over_clox@lemmy.world 2 points 2 weeks ago* (last edited 2 weeks ago)

Guess you never heard of 32 bit DOS that ticks underneath Windows 95 and 98.

Read the ASM file, the literal first line is bits 16

It legit forces the CPU out of protected mode and back into real mode, even and especially under a protected mode 32 bit OS.

[–] thenextguy@lemmy.world 1 points 2 weeks ago

As far as I can see this doesn't do anything. It just calls int21 0x4B which is just exec. Not related to dpmi or anything like that.