Interesting - I'm curious how common that actually was back in the
day, though? I don't recall a lot of DOS applications that I used
chaining from one EXE to another, unless you were really into
launcher-menu type utilities; most of what I remember was single
EXEs for the main program plus accessory EXEs for configuration
(i.e. the inevitable SOUNDSET.EXE and its ilk,) and transfer of
control was usually mediated by a *.BAT launcher script.
It was common enough to be known amongst every coder I knew. Some programmers too. Take some of the multi floppy install packages for
example. Some decrypted the necessary materials as they built the
primary file on your computer. The primary file wouldn't always have
a proper executable extension, but, it was still actually an .EXE
most of the time.
On Tue, 2 Dec 2025 20:13:15 -0000 (UTC)
Gremlin <nobody@haph.org> wrote:
Interesting - I'm curious how common that actually was back in the
day, though? I don't recall a lot of DOS applications that I used
chaining from one EXE to another, unless you were really into
launcher-menu type utilities; most of what I remember was single
EXEs for the main program plus accessory EXEs for configuration
(i.e. the inevitable SOUNDSET.EXE and its ilk,) and transfer of
control was usually mediated by a *.BAT launcher script.
It was common enough to be known amongst every coder I knew. Some
programmers too. Take some of the multi floppy install packages for
example. Some decrypted the necessary materials as they built the
primary file on your computer. The primary file wouldn't always have
a proper executable extension, but, it was still actually an .EXE
most of the time.
Huh, I'm trying to model what an exploit would look like here - who &
what would be vulnerable to this? Obviously you *can* create a disk
file with a non-EXE extension & whatever contents you want, but under
what circumstances is another program gonna call the load-and-execute
routine on any arbitrary filename (other than, as mentioned, app-menu utilities or command-shell alternatives?) Or if the game is to replace
one of an application suite's own I-can't-believe-it's-not-EXEs with a Trojan, which developers bothered to mask their secondary EXEs under a different extension, and why...?
(I mean, yes, installers might well build a final EXE from smaller
and/or compressed/encrypted chunks, but the *resulting* file would
normally still have an EXE extension, and be invoked the usual way.)
Not saying that it doesn't make sense to check files on a better-safe- than-sorry heuristic, just trying to figure out how you'd get to the
point of pulling that kind of trick in the first place...
On Tue, 2 Dec 2025 20:13:15 -0000 (UTC)
Gremlin <nobody@haph.org> wrote:
Huh, I'm trying to model what an exploit would look like here - who &
what would be vulnerable to this? Obviously you *can* create a disk
file with a non-EXE extension & whatever contents you want, but under
what circumstances is another program gonna call the load-and-execute
routine on any arbitrary filename (other than, as mentioned, app-menu utilities or command-shell alternatives?) Or if the game is to replace
one of an application suite's own I-can't-believe-it's-not-EXEs with a Trojan, which developers bothered to mask their secondary EXEs under a different extension, and why...?
Not saying that it doesn't make sense to check files on a better-safe- than-sorry heuristic, just trying to figure out how you'd get to the
point of pulling that kind of trick in the first place...
John Ames <commodorejohn@gmail.com> news:20251203083900.00002c04@gmail.com Wed, 03 Dec 2025 16:39:00 GMT in comp.os.linux.advocacy, wrote:
On Tue, 2 Dec 2025 20:13:15 -0000 (UTC)
Gremlin <nobody@haph.org> wrote:
Huh, I'm trying to model what an exploit would look like here - who &
what would be vulnerable to this? Obviously you *can* create a disk
file with a non-EXE extension & whatever contents you want, but under
what circumstances is another program gonna call the load-and-execute
routine on any arbitrary filename (other than, as mentioned, app-menu
utilities or command-shell alternatives?) Or if the game is to replace
one of an application suite's own I-can't-believe-it's-not-EXEs with a
Trojan, which developers bothered to mask their secondary EXEs under a
different extension, and why...?
I wasn't writing about trojans using this? A trojan obviously could, but, that isn't what I was describing...
I was writing about some installers doing it. Just not using a .bat file
to pass control but doing it themselves. They'd recombine pieces of the executable (a chunk on each floppy for example) and then pass control to
the final resulting file which would be an .EXE, but not necessarily with that file extension.
I suppose one could think of it as a very simple way to keep 'nosey'
people out? If the program comes with an install.exe and some 1,2,3 etc
files that turn into a .DAT file; you probably won't give it a second look. You assume that because it's a .DAT file that it cannot be directly
executed- that the install.exe is doing all the work. And it's using the
.DAT file for instructions/configuration/data, etc, not that the .DAT file
is the next stage of the install process itself.
As for the trojan aspect you bring up, I did once use a .DLL file as a
marker so that the program wouldn't access your email client for the 2nd
time and email anyone again. The file wasn't really a .DLL though, but you wouldn't have been the wiser if you didn't actually examine it. It had a legitimate Windows name with proper date/time stamps that would trick you into thinking the file was as old as the rest of the common .DLLs on your machine - You wouldn't have known it was created that morning for example. Using DOS interrupts...
Here's a little code from the program I was writing about. It's primarily written in an ancient DOS based language called ASIC. v5 specifically.
rem ***Get/Set Date/Time stamps
get_fdt:
if file_handle>4 then
AX=&HEX5700
BX=FILE_HANDLE
INT86(&HEX21,AX,BX,CX,DX,NA,NA,NA,NA,NA)
NEWDATE=CX
NEWTIME=DX
endif
RETURN
set_fdt:
if file_handle>4 then
AX=&HEX5701
BX=FILE_HANDLE
CX=NEWDATE
DX=NEWTIME
INT86(&HEX21,AX,BX,CX,DX,NA,NA,NA,NA,NA)
endif
RETURN
And these are the interrupts to get the current attribute and null it and then put it back later...
rem ***Attribute get/set interrupts
get_attr:
AX = &HEX4300
DX = VARPTR(Filename$)
CX = NewAttr
INT86(&HEX21,AX,NA,CX,DX,NA,NA,NA,NA,NA)
return
set_attr:
AX = &HEX4301
DX = VARPTR(Filename$)
CX = NewAttr
INT86(&HEX21,AX,NA,CX,DX,NA,NA,NA,NA,NA)
return
You just set newattr=0 and make the call, tada; now it's a normal file suitable for read/write.
Save it beforehand with the get attr call, save the variable, call the set routine again when you're finished phucking around with it.
Which is what this subroutine did:
pre_open:
rem *** routine when called with getem=0 will
rem obtain the current file attributes, retain this
rem and reset the attribute to null for read/write.
rem If called with getem=1 it will restore the attribute
rem to what it was previously.
if getem=0 then
gosub get_attr:
oldattr=newattr
newattr=0
gosub set_attr:
else
newattr=oldattr
gosub set_attr:
endif
return
ASICs built in file I/O routines left much to be desired speed wise, and
when you're moving 10k or more around, you want it done fast. You don't
have time to phuck around going byte by byte. Nah, you allocate some
memory and pull a chunk all at once with a single DOS interrupt call.
Super fucking quick. Plus once it's in memory, you can do whatever needs
to be done much faster than doing it with the file on disk. RAM is faster after all. then set the file pointer, dump the ram content right back -
again super fucking quick. I was trying to explain this previously but it somehow got lost in translation I suppose.
You'll have to ignore the comments, the 'engine' is c/p from a particular piece of self replicating code I wrote decades ago.
rem open_file chart!
rem ax=&hex3d00
rem read-only
rem ax=&hex3d01
rem write only
rem ax=&hex3d02
rem read/write
open_file:
rem See chart for access mode used.
AX=&HEX3D02
DX = VARPTR(Filename$)
INT86(&HEX21,AX,NA,na,DX,NA,NA,NA,NA,NA)
file_handle=ax
return
write_file:
rem this routine will write selected bytes at whatever current position
rem from whatever buffer i choose into the file.
rem if the routine did not write all data ax will not equal cx upon
rem return from int call.
rem define dx register before calling this routine to point to the
rem memory address of the buffer area you want to write from. like so:
rem dx=varptr(buffer(0))
rem cx is how many bytes to write :)
if file_handle>4 then
ax=&hex4000
bx=file_handle
cx=bytesize
int86(&hex21,ax,bx,cx,dx,na,na,na,na,na)
byteswritten=ax
endif
return
read_file:
rem as the name implies, it reads bytes into a buffer. :-)
rem as with write_file, you need to predefine the dx register for the
rem buffer where you want the info stored. Like so: dx=varptr(buffer(0))
rem if you don't, this routine will not work, or will overwrite some
rem other section of memory. And for virus coding, this is very bad! :)
rem cx register is how many bytes to read :)
if file_handle>4 then
ax=&hex3f00
bx=file_handle
cx=bytesize
int86(&hex21,ax,bx,cx,dx,na,na,na,na,na)
bytesread=ax
endif
return
close_file:
rem Close the file handle. If the file handle is less then 4, then
rem this routine will simply exit.
if file_handle>4 then
ax=&hex3e00
bx=file_handle
int86(&hex21,ax,bx,na,na,na,na,na,na,na)
endif
return
Why muck around with byte for byte reads and writes when you can have the
OS give you much bigger chunks at once right? It's assembler speed without actually doing it in asm. It's not slow. Which is why I said previously
that you could save considerable time by doing a quick looksee at the file before you opted to scan the entire damn thing.
The only limit to how many bytes that could be read/written in one go was
the size of your allocated memory. Using straight up interrupt calls, just like you would have in pure assembly is going to be faster than whatever
file i/o functions your HLL language of choice had available to you. Your completely bypassing the fluff. The drawback is that you are entirely on
your own if you go this route. You could for example, screwup and ask to
read more bytes than you allocated memory for. If you do this, you will overwrite some other region of memory with the extra bytes. which usually leads to a crash scenario. But, if you're creative and understand how your executable is built, you can take advantage of that and instead of a crash cause code execution instead - those extra bytes are executable machine
code that you intended to load this way. That's a sneaky, but very old, method of getting around hueristics that might check to see what you're doing. They assume it's a standard interrupt call to read bytes, not considering that you're also using it to jmp to another location in memory with additional code it doesn't presently see because that special code
isn't already in your main program.
Not saying that it doesn't make sense to check files on a better-safe-
than-sorry heuristic, just trying to figure out how you'd get to the
point of pulling that kind of trick in the first place...
It's not really a trick though. It was just using a DOS interrupt as intended. As I wrote initially, file extensions really don't tell you what the file actually is. They never did.
I wasn't writing about trojans using this? A trojan obviously could,
but, that isn't what I was describing...
On Dec 3, 2025 at 3:03:12 PM MST, "Gremlin" wrote <XnsB3AAAD7A1C510HT1@cF04o3ON7k2lx05.lLC.9r5>:
Most of what you're describing is technically possible under DOS, but
the way you're framing it doesn’t match how real software of the era operated.
Yes, DOS will EXEC a file regardless of extension if the caller
specifies it. No, DOS installers were not commonly stitching together disguised EXE chunks under .DAT files. That's an edge case at best.
Your interrupt calls seem legit, but "reading past a buffer to trigger execution" is more movie-hacker than real-world practice; DOS viruses
mostly used explicit jumps, not accidental overreads.
Extensions mattered to the command shell even if EXEC didn't care.
Saying "extensions never meant anything" is just flat wrong.
On Wed, 3 Dec 2025 22:03:12 -0000 (UTC)
Gremlin <nobody@haph.org> wrote:
I wasn't writing about trojans using this? A trojan obviously could,
but, that isn't what I was describing...
Ah - perhaps I had a context lapse since this initially came up in a discussion on virus scanning.
Brock McNuggets <brock.mcnuggets@gmail.com> news:6930bb75$7$26$882e4bbb@reader.netnews.com Wed, 03 Dec 2025 22:36:37
GMT in comp.os.linux.advocacy, wrote:
On Dec 3, 2025 at 3:03:12 PM MST, "Gremlin" wrote
<XnsB3AAAD7A1C510HT1@cF04o3ON7k2lx05.lLC.9r5>:
Most of what you're describing is technically possible under DOS, but
the way you're framing it doesn’t match how real software of the era
operated.
All of what I described (buffer overrun specifically) works under DOS, os/2warp, Windows, Linux and MacOS.
You do this often -- argue against bizarre straw men you create. And you do so
out of your own hatred and personal issues. Try to do better!
You do this often -- argue against bizarre straw men you create.
And you do so out of your own hatred and personal issues. Try to do
better!
Clearly a Marxist.
On Thu, 4 Dec 2025 14:35:52 +0000
The Natural Philosopher <tnp@invalid.invalid> wrote:
You do this often -- argue against bizarre straw men you create.
And you do so out of your own hatred and personal issues. Try to do
better!
Clearly a Marxist.
The irony here is palpable.
You do this often -- argue against bizarre straw men you create.
And you do so out of your own hatred and personal issues. Try to
do better!
Clearly a Marxist.
The irony here is palpable.I'm no Marxist chum
On Thu, 4 Dec 2025 18:05:17 +0000
The Natural Philosopher <tnp@invalid.invalid> wrote:
I'm no Marxist chumYou do this often -- argue against bizarre straw men you create.
And you do so out of your own hatred and personal issues. Try to
do better!
Clearly a Marxist.
The irony here is palpable.
No, but you *do* seem to be in need of a refresher on elementary set
theory, even if we take your opinion on Marxist rhetorical tendencies
as gospel.
I'm no Marxist chumYou do this often -- argue against bizarre straw men you create.
And you do so out of your own hatred and personal issues. Try to
do better!
Clearly a Marxist.
The irony here is palpable.
No, but you *do* seem to be in need of a refresher on elementary set theory, even if we take your opinion on Marxist rhetorical
tendencies as gospel.
I am afraid that one whooshed right over my head.
On Thu, 4 Dec 2025 19:09:30 +0000
The Natural Philosopher <tnp@invalid.invalid> wrote:
I'm no Marxist chumYou do this often -- argue against bizarre straw men you create. >>>>>>> And you do so out of your own hatred and personal issues. Try to >>>>>>> do better!
Clearly a Marxist.
The irony here is palpable.
No, but you *do* seem to be in need of a refresher on elementary set
theory, even if we take your opinion on Marxist rhetorical
tendencies as gospel.
I am afraid that one whooshed right over my head.
Even if we take "members of group A exhibit property B" as a given,
that does not in itself mean that all entities exhibiting property B
are members of group A.
On Dec 3, 2025 at 8:05:22 PM MST, "Gremlin" wrote <XnsB3AAE0B49172CHT1@cF04o3ON7k2lx05.lLC.9r5>:
Brock McNuggets <brock.mcnuggets@gmail.com>
news:6930bb75$7$26$882e4bbb@reader.netnews.com Wed, 03 Dec 2025
22:36:37 GMT in comp.os.linux.advocacy, wrote:
On Dec 3, 2025 at 3:03:12 PM MST, "Gremlin" wrote
<XnsB3AAAD7A1C510HT1@cF04o3ON7k2lx05.lLC.9r5>:
Most of what you're describing is technically possible under DOS, but
the way you're framing it doesn’t match how real software of the era
operated.
All of what I described (buffer overrun specifically) works under DOS,
os/2warp, Windows, Linux and MacOS.
Nobody said otherwise. Seriously, not one person ever did. Certainly not
me.
Please try to read for comprehension and not just attack. It would help
you a lot.
On Thu, 4 Dec 2025 14:35:52 +0000
The Natural Philosopher <tnp@invalid.invalid> wrote:
You do this often -- argue against bizarre straw men you create.
And you do so out of your own hatred and personal issues. Try to do
better!
Clearly a Marxist.
The irony here is palpable.
--<https://tinyurl.com/WhatIsSnit>
<https://tinyurl.com/Snitliesmethods>
<https://tinyurl.com/Snit-Reviews>
<https://tinyurl.com/Snitwhopperlie>
<https://tinyurl.com/Snit-teddybear>
<https://tinyurl.com/Snitonduck>
<https://tinyurl.com/Snitongoogle>
<https://tinyurl.com/Snitdrugabuse1>
<https://tinyurl.com/Snitdrugabuse2>
<https://tinyurl.com/Snitdrugabuse3>
<https://tinyurl.com/Snitdrugabuse4>
<https://tinyurl.com/Snitdrugabuse5>
<https://tinyurl.com/Snitdrugabuse6>
<https://tinyurl.com/Snitdrugabuse7>
<https://tinyurl.com/Snitdrugabuse8>
<https://tinyurl.com/Snitdrugabuse9>
<https://tinyurl.com/Snitdrugabuse10>
<https://tinyurl.com/Snitdrugabuse11>
On 04/12/2025 14:24, Brock McNuggets wrote:
You do this often -- argue against bizarre straw men you create. And
you do so out of your own hatred and personal issues. Try to do better!
Clearly a Marxist.
<https://tinyurl.com/WhatIsSnit>
<https://tinyurl.com/Snitliesmethods>
<https://tinyurl.com/Snit-Reviews>
<https://tinyurl.com/Snitwhopperlie>
<https://tinyurl.com/Snit-teddybear>
<https://tinyurl.com/Snitonduck>
<https://tinyurl.com/Snitongoogle>
<https://tinyurl.com/Snitdrugabuse1>
<https://tinyurl.com/Snitdrugabuse2>
<https://tinyurl.com/Snitdrugabuse3>
<https://tinyurl.com/Snitdrugabuse4>
<https://tinyurl.com/Snitdrugabuse5>
<https://tinyurl.com/Snitdrugabuse6>
<https://tinyurl.com/Snitdrugabuse7>
<https://tinyurl.com/Snitdrugabuse8>
<https://tinyurl.com/Snitdrugabuse9>
<https://tinyurl.com/Snitdrugabuse10>
<https://tinyurl.com/Snitdrugabuse11>
The Natural Philosopher <tnp@invalid.invalid> news:10gs688$bvup$2@dont-email.me Thu, 04 Dec 2025 14:35:52 GMT in comp.os.linux.advocacy, wrote:
On 04/12/2025 14:24, Brock McNuggets wrote:
You do this often -- argue against bizarre straw men you create. And
you do so out of your own hatred and personal issues. Try to do better!
Clearly a Marxist.
ROFL! Try not to take all of the jenkem snit likes to share at once, ok?
John Ames <commodorejohn@gmail.com> news:20251204082129.000038cc@gmail.com Thu, 04 Dec 2025 16:21:29 GMT in comp.os.linux.advocacy, wrote:
On Thu, 4 Dec 2025 14:35:52 +0000
The Natural Philosopher <tnp@invalid.invalid> wrote:
You do this often -- argue against bizarre straw men you create.
And you do so out of your own hatred and personal issues. Try to do
better!
Clearly a Marxist.
The irony here is palpable.
ROFL, isn't it though.
Brock McNuggets <brock.mcnuggets@gmail.com> news:6931999a$6$21$882e4bbb@reader.netnews.com Thu, 04 Dec 2025 14:24:26
GMT in comp.os.linux.advocacy, wrote:
On Dec 3, 2025 at 8:05:22 PM MST, "Gremlin" wrote
<XnsB3AAE0B49172CHT1@cF04o3ON7k2lx05.lLC.9r5>:
Brock McNuggets <brock.mcnuggets@gmail.com>
news:6930bb75$7$26$882e4bbb@reader.netnews.com Wed, 03 Dec 2025
22:36:37 GMT in comp.os.linux.advocacy, wrote:
On Dec 3, 2025 at 3:03:12 PM MST, "Gremlin" wrote
<XnsB3AAAD7A1C510HT1@cF04o3ON7k2lx05.lLC.9r5>:
Most of what you're describing is technically possible under DOS, but
the way you're framing it doesn’t match how real software of the era >>>> operated.
All of what I described (buffer overrun specifically) works under DOS,
os/2warp, Windows, Linux and MacOS.
Nobody said otherwise. Seriously, not one person ever did. Certainly not
me.
Yes, you did.
read_file: rem as the name implies, it reads bytes into a buffer. :-)
rem as with write_file, you need to predefine the dx register for the
rem buffer where you want the info stored. Like so:
dx=varptr(buffer(0)) rem if you don't, this routine will not work, or
will overwrite some rem other section of memory. And for virus
coding, this is very bad! :) rem cx register is how many bytes to
read :) if file_handle>4 then ax=&hex3f00 bx=file_handle cx=bytesize int86(&hex21,ax,bx,cx,dx,na,na,na,na,na) bytesread=ax endif return
At Wed, 3 Dec 2025 22:03:12 -0000 (UTC), Gremlin <nobody@haph.org>
wrote:
read_file: rem as the name implies, it reads bytes into a buffer. :-)
rem as with write_file, you need to predefine the dx register for the
rem buffer where you want the info stored. Like so:
dx=varptr(buffer(0)) rem if you don't, this routine will not work, or
will overwrite some rem other section of memory. And for virus
coding, this is very bad! :) rem cx register is how many bytes to
read :) if file_handle>4 then ax=&hex3f00 bx=file_handle cx=bytesize
int86(&hex21,ax,bx,cx,dx,na,na,na,na,na) bytesread=ax endif return
Hey, just wanted to mention that Linux used to use int86(0x80,...)
for its own syscalls. In C, read(2) is the way to read into a buffer,
which would set up the syscall (call to interrupt 0x80). I guess in DOS,
C would set up the interrupt call similar to how you show, and then
call the interrupt.
Modern processors have an actual SYSCALL intrinsic, so no more interrupt
call to enter the kernel.
I remember DOS interrupts 0x21 (DOS itself), and 0x10(BIOS, iirc).
vallor <vallor@vallor.earth> news:10h2u70$36bnl$1@dont-email.me Sun,
07 Dec 2025 04:01:36 GMT in comp.os.linux.advocacy, wrote:
At Wed, 3 Dec 2025 22:03:12 -0000 (UTC), Gremlin <nobody@haph.org>
wrote:
read_file: rem as the name implies, it reads bytes into a buffer.
:-) rem as with write_file, you need to predefine the dx register
for the rem buffer where you want the info stored. Like so:
dx=varptr(buffer(0)) rem if you don't, this routine will not work,
or will overwrite some rem other section of memory. And for virus
coding, this is very bad! :) rem cx register is how many bytes to
read :) if file_handle>4 then ax=&hex3f00 bx=file_handle
cx=bytesize int86(&hex21,ax,bx,cx,dx,na,na,na,na,na) bytesread=ax
endif return
Hey, just wanted to mention that Linux used to use int86(0x80,...)
for its own syscalls. In C, read(2) is the way to read into a
buffer, which would set up the syscall (call to interrupt 0x80). I
guess in DOS, C would set up the interrupt call similar to how you
show, and then call the interrupt.
I remember from writing elf binaries. <G> Fun and educational times.
Modern processors have an actual SYSCALL intrinsic, so no more
interrupt call to enter the kernel.
Windows API calls can still be used to enter the kernel. Modern CPUs
running a flavor of DOS still respect DOS interrupt calls when
running in 'real mode' kernel entrance. It's known as 'real mode' vs 'Protected mode and virtualization'
As for Linux, here's a c/p from google AI:
Yes, Linux absolutely uses interrupts and interrupt calls (like the
syscall instruction on modern CPUs) to allow user-space processes to
request kernel services, enabling privileged kernel access for tasks
like file I/O or process management, with specific mechanisms like
IRQs for hardware, `syscall` for system calls, and exceptions for
errors all transitioning the CPU to kernel mode (Ring 0) to execute privileged code. Modern systems use efficient instructions like
syscall for system calls, but the core principle of interrupt-driven transitions to kernel space for privileged operations remains
fundamental. ***
The 286 was the first to offer protected mode access. It was
significantly improved with the 386. Modern CPUs still offer real
mode as well. So, I'm not sure what you mean exactly by a modern CPU
in this instance? Or what you mean by no more interrupt call to enter
the kernel?
--I remember DOS interrupts 0x21 (DOS itself), and 0x10(BIOS, iirc).
<G> It takes me back man.
At Mon, 8 Dec 2025 02:32:39 -0000 (UTC), Gremlin <nobody@haph.org>
wrote:
vallor <vallor@vallor.earth> news:10h2u70$36bnl$1@dont-email.me Sun,
07 Dec 2025 04:01:36 GMT in comp.os.linux.advocacy, wrote:
At Wed, 3 Dec 2025 22:03:12 -0000 (UTC), Gremlin <nobody@haph.org>
wrote:
read_file: rem as the name implies, it reads bytes into a buffer.
:-) rem as with write_file, you need to predefine the dx register
for the rem buffer where you want the info stored. Like so:
dx=varptr(buffer(0)) rem if you don't, this routine will not work,
or will overwrite some rem other section of memory. And for virus
coding, this is very bad! :) rem cx register is how many bytes to
read :) if file_handle>4 then ax=&hex3f00 bx=file_handle
cx=bytesize int86(&hex21,ax,bx,cx,dx,na,na,na,na,na) bytesread=ax
endif return
Hey, just wanted to mention that Linux used to use int86(0x80,...)
for its own syscalls. In C, read(2) is the way to read into a
buffer, which would set up the syscall (call to interrupt 0x80). I
guess in DOS, C would set up the interrupt call similar to how you
show, and then call the interrupt.
I remember from writing elf binaries. <G> Fun and educational times.
Modern processors have an actual SYSCALL intrinsic, so no more
interrupt call to enter the kernel.
Windows API calls can still be used to enter the kernel. Modern CPUs running a flavor of DOS still respect DOS interrupt calls when
running in 'real mode' kernel entrance. It's known as 'real mode' vs 'Protected mode and virtualization'
As for Linux, here's a c/p from google AI:
Yes, Linux absolutely uses interrupts and interrupt calls (like the
syscall instruction on modern CPUs) to allow user-space processes to request kernel services, enabling privileged kernel access for tasks
like file I/O or process management, with specific mechanisms like
IRQs for hardware, `syscall` for system calls, and exceptions for
errors all transitioning the CPU to kernel mode (Ring 0) to execute privileged code. Modern systems use efficient instructions like
syscall for system calls, but the core principle of interrupt-driven transitions to kernel space for privileged operations remains
fundamental. ***
The 286 was the first to offer protected mode access. It was
significantly improved with the 386. Modern CPUs still offer real
mode as well. So, I'm not sure what you mean exactly by a modern CPU
in this instance? Or what you mean by no more interrupt call to enter
the kernel?
Exactly. "SYSCALL" is an opcode on x86_64 processors, and from
what I've read, it's faster than using an interrupt. (But don't
quote me on that. ;) )
My main point, though, was the similarity of how DOS handled
things -- it's basically the old-style "syscall" (setting up
registers, maybe some stack, and then raising an interrupt),
even if it wasn't known as a "syscall".
I remember DOS interrupts 0x21 (DOS itself), and 0x10(BIOS, iirc).
<G> It takes me back man.
At Mon, 08 Dec 2025 04:36:08 +0000, vallor <vallor@vallor.earth> wrote:
At Mon, 8 Dec 2025 02:32:39 -0000 (UTC), Gremlin <nobody@haph.org>
wrote:
vallor <vallor@vallor.earth> news:10h2u70$36bnl$1@dont-email.me Sun,
07 Dec 2025 04:01:36 GMT in comp.os.linux.advocacy, wrote:
At Wed, 3 Dec 2025 22:03:12 -0000 (UTC), Gremlin <nobody@haph.org>
wrote:
read_file: rem as the name implies, it reads bytes into a buffer.
:-) rem as with write_file, you need to predefine the dx register
for the rem buffer where you want the info stored. Like so:
dx=varptr(buffer(0)) rem if you don't, this routine will not work,
or will overwrite some rem other section of memory. And for virus
coding, this is very bad! :) rem cx register is how many bytes to
read :) if file_handle>4 then ax=&hex3f00 bx=file_handle
cx=bytesize int86(&hex21,ax,bx,cx,dx,na,na,na,na,na) bytesread=ax
endif return
Hey, just wanted to mention that Linux used to use int86(0x80,...)
for its own syscalls. In C, read(2) is the way to read into a
buffer, which would set up the syscall (call to interrupt 0x80). I
guess in DOS, C would set up the interrupt call similar to how you
show, and then call the interrupt.
I remember from writing elf binaries. <G> Fun and educational times.
Modern processors have an actual SYSCALL intrinsic, so no more
interrupt call to enter the kernel.
Windows API calls can still be used to enter the kernel. Modern CPUs
running a flavor of DOS still respect DOS interrupt calls when
running in 'real mode' kernel entrance. It's known as 'real mode' vs
'Protected mode and virtualization'
As for Linux, here's a c/p from google AI:
Yes, Linux absolutely uses interrupts and interrupt calls (like the
syscall instruction on modern CPUs) to allow user-space processes to
request kernel services, enabling privileged kernel access for tasks
like file I/O or process management, with specific mechanisms like
IRQs for hardware, `syscall` for system calls, and exceptions for
errors all transitioning the CPU to kernel mode (Ring 0) to execute
privileged code. Modern systems use efficient instructions like
syscall for system calls, but the core principle of interrupt-driven
transitions to kernel space for privileged operations remains
fundamental. ***
The 286 was the first to offer protected mode access. It was
significantly improved with the 386. Modern CPUs still offer real
mode as well. So, I'm not sure what you mean exactly by a modern CPU
in this instance? Or what you mean by no more interrupt call to enter
the kernel?
Exactly. "SYSCALL" is an opcode on x86_64 processors, and from
what I've read, it's faster than using an interrupt. (But don't
quote me on that. ;) )
My main point, though, was the similarity of how DOS handled
things -- it's basically the old-style "syscall" (setting up
registers, maybe some stack, and then raising an interrupt),
even if it wasn't known as a "syscall".
I remember DOS interrupts 0x21 (DOS itself), and 0x10(BIOS, iirc).
<G> It takes me back man.
BTW, outlining my thought process:
Saw your call to int86(0x21,...) to read to a buffer.
Recognized that as basically the same as Linux's (old)
syscall mechanism of raising an interrupt to call the kernel ABI.
Looked up the "syscall interrupt" on the net, discovered that it
used to be 0x80, but now newer processors use a new opcode,
"SYSCALL".
...and so forth.
Well, I did find Lounge Lizard Larry to be quite addictive.Leisure Suit Larry.
At Mon, 8 Dec 2025 02:32:39 -0000 (UTC), Gremlin <nobody@haph.org>
wrote:
vallor <vallor@vallor.earth> news:10h2u70$36bnl$1@dont-email.me Sun,
07 Dec 2025 04:01:36 GMT in comp.os.linux.advocacy, wrote:
At Wed, 3 Dec 2025 22:03:12 -0000 (UTC), Gremlin <nobody@haph.org>
wrote:
read_file: rem as the name implies, it reads bytes into a buffer.
:-) rem as with write_file, you need to predefine the dx register
for the rem buffer where you want the info stored. Like so:
dx=varptr(buffer(0)) rem if you don't, this routine will not work,
or will overwrite some rem other section of memory. And for virus
coding, this is very bad! :) rem cx register is how many bytes to
read :) if file_handle>4 then ax=&hex3f00 bx=file_handle
cx=bytesize int86(&hex21,ax,bx,cx,dx,na,na,na,na,na) bytesread=ax
endif return
Hey, just wanted to mention that Linux used to use int86(0x80,...)
for its own syscalls. In C, read(2) is the way to read into a
buffer, which would set up the syscall (call to interrupt 0x80). I
guess in DOS, C would set up the interrupt call similar to how you
show, and then call the interrupt.
I remember from writing elf binaries. <G> Fun and educational times.
Modern processors have an actual SYSCALL intrinsic, so no more
interrupt call to enter the kernel.
Windows API calls can still be used to enter the kernel. Modern CPUs
running a flavor of DOS still respect DOS interrupt calls when
running in 'real mode' kernel entrance. It's known as 'real mode' vs
'Protected mode and virtualization'
As for Linux, here's a c/p from google AI:
Yes, Linux absolutely uses interrupts and interrupt calls (like the
syscall instruction on modern CPUs) to allow user-space processes to
request kernel services, enabling privileged kernel access for tasks
like file I/O or process management, with specific mechanisms like
IRQs for hardware, `syscall` for system calls, and exceptions for
errors all transitioning the CPU to kernel mode (Ring 0) to execute
privileged code. Modern systems use efficient instructions like
syscall for system calls, but the core principle of interrupt-driven
transitions to kernel space for privileged operations remains
fundamental. ***
The 286 was the first to offer protected mode access. It was
significantly improved with the 386. Modern CPUs still offer real
mode as well. So, I'm not sure what you mean exactly by a modern CPU
in this instance? Or what you mean by no more interrupt call to enter
the kernel?
Exactly. "SYSCALL" is an opcode on x86_64 processors, and from
what I've read, it's faster than using an interrupt. (But don't
quote me on that. ;) )
My main point, though, was the similarity of how DOS handled
things -- it's basically the old-style "syscall" (setting up
registers, maybe some stack, and then raising an interrupt),
even if it wasn't known as a "syscall".
Way back in the dark ages I was fascinated by copy protection schemes
that were being used at the time and some of them used undocumented
INT 21h calls.
I found it interesting at the time even though I wasn't a hardcore
gamer.
Well, I did find Lounge Lizard Larry to be quite addictive.
At Mon, 08 Dec 2025 04:36:08 +0000, vallor <vallor@vallor.earth> wrote:
At Mon, 8 Dec 2025 02:32:39 -0000 (UTC), Gremlin <nobody@haph.org> wrote: >>> vallor <vallor@vallor.earth> news:10h2u70$36bnl$1@dont-email.me Sun,
07 Dec 2025 04:01:36 GMT in comp.os.linux.advocacy, wrote:
At Wed, 3 Dec 2025 22:03:12 -0000 (UTC), Gremlin <nobody@haph.org> wrote:
Looked up the "syscall interrupt" on the net, discovered that it
used to be 0x80, but now newer processors use a new opcode,
"SYSCALL".
...and so forth.
pothead <pothead@snakebite.com> news:10h7mil$fq1s$1@pothead.dont-email.me Mon,
08 Dec 2025 23:21:57 GMT in comp.os.linux.advocacy, wrote:
Way back in the dark ages I was fascinated by copy protection schemes
that were being used at the time and some of them used undocumented
INT 21h calls.
Yep! Did you ever see any of them rerouting any while they were in use? Sneaky
bastages.
I found it interesting at the time even though I wasn't a hardcore
gamer.
Well, I did find Lounge Lizard Larry to be quite addictive.
<G> That series was fun!
Beat the pants off (no pun intended) of Where in the world is Carmen sandiego.
Give a Democrat a fish and he'll eat all day.
Teach a Democrat to fish and......
He'll steal your rod
Take your wallet
Assault the fish &
Blame Trump.
On 2025-12-10, Gremlin <nobody@haph.org> wrote:
pothead <pothead@snakebite.com>
news:10h7mil$fq1s$1@pothead.dont-email.me Mon, 08 Dec 2025 23:21:57 GMT
in comp.os.linux.advocacy, wrote:
Way back in the dark ages I was fascinated by copy protection schemes
that were being used at the time and some of them used undocumented
INT 21h calls.
Yep! Did you ever see any of them rerouting any while they were in use?
Sneaky bastages.
I have heard something about that but personally I don't recall
experiencing it myself. It might explain why I sometimes had
difficulties tracing what the code was doing. Expected vs actual
results.
I found it interesting at the time even though I wasn't a hardcore
gamer.
Well, I did find Lounge Lizard Larry to be quite addictive.
<G> That series was fun!
Beat the pants off (no pun intended) of Where in the world is Carmen
sandiego.
I never understood the fascination with that game.
Maybe I missed the point?
pothead <pothead@snakebite.com> news:10hcd85$1m977$1@pothead.dont-email.me Wed, 10 Dec 2025 18:13:25 GMT in comp.os.linux.advocacy, wrote:
On 2025-12-10, Gremlin <nobody@haph.org> wrote:
pothead <pothead@snakebite.com>
news:10h7mil$fq1s$1@pothead.dont-email.me Mon, 08 Dec 2025 23:21:57 GMT
in comp.os.linux.advocacy, wrote:
Way back in the dark ages I was fascinated by copy protection schemes
that were being used at the time and some of them used undocumented
INT 21h calls.
Yep! Did you ever see any of them rerouting any while they were in use?
Sneaky bastages.
I have heard something about that but personally I don't recall
experiencing it myself. It might explain why I sometimes had
difficulties tracing what the code was doing. Expected vs actual
results.
I found it interesting at the time even though I wasn't a hardcore
gamer.
Well, I did find Lounge Lizard Larry to be quite addictive.
On 12/12/2025 6:44 pm, Gremlin wrote:
pothead <pothead@snakebite.com>
news:10hcd85$1m977$1@pothead.dont-email.me
Wed, 10 Dec 2025 18:13:25 GMT in comp.os.linux.advocacy, wrote:
On 2025-12-10, Gremlin <nobody@haph.org> wrote:
pothead <pothead@snakebite.com>
news:10h7mil$fq1s$1@pothead.dont-email.me Mon, 08 Dec 2025 23:21:57 GMT >>>> in comp.os.linux.advocacy, wrote:
Way back in the dark ages I was fascinated by copy protection schemes >>>>> that were being used at the time and some of them used undocumented
INT 21h calls.
Yep! Did you ever see any of them rerouting any while they were in use? >>>> Sneaky bastages.
I have heard something about that but personally I don't recall
experiencing it myself. It might explain why I sometimes had
difficulties tracing what the code was doing. Expected vs actual
results.
I found it interesting at the time even though I wasn't a hardcore
gamer.
Well, I did find Lounge Lizard Larry to be quite addictive.
Wasn't it "Leasuresuit Larry in the Land of the Lounge Lizards"!! (Did
all the Devs have a name beginning with 'L' or something??)
| Sysop: | DaiTengu |
|---|---|
| Location: | Appleton, WI |
| Users: | 1,089 |
| Nodes: | 10 (0 / 10) |
| Uptime: | 153:50:34 |
| Calls: | 13,921 |
| Calls today: | 2 |
| Files: | 187,021 |
| D/L today: |
3,754 files (944M bytes) |
| Messages: | 2,457,163 |