• Please review our updated Terms and Rules here

Preserving data in RAM while a booter is running

VileR

Veteran Member
Joined
Jul 21, 2011
Messages
647
Location
Israel
For my own purposes I need to test some self-booting IBM PC sofware in a slightly altered environment. More specifically, the idea is to boot first into my own code, which does the following:

- Copy a small BIOS data table to somewhere in RAM and modify it
- Target the relevant pointer (in the IVT) at my modified copy
- Prompt for a new disk (the software I wish to run) and let its boot loader take over

This should all be fairly straightforward... except for one thing: How to minimize the odds that next program will clobber my data table. I know I can't make it *impossible*, so "somehwat unlikely" will have to do.

Most booter software doesn't tend to hog every last drop of RAM; so my current idea is to place my table at the top of memory, and reduce the reported memory size in the BIOS Data Area (1K will do) before transferring control to the next program. A reasonably safe approach? Any downsides/other considerations I might be missing?
 
For my own purposes I need to test some self-booting IBM PC sofware in a slightly altered environment. More specifically, the idea is to boot first into my own code, which does the following:

- Copy a small BIOS data table to somewhere in RAM and modify it
- Target the relevant pointer (in the IVT) at my modified copy
- Prompt for a new disk (the software I wish to run) and let its boot loader take over

This should all be fairly straightforward... except for one thing: How to minimize the odds that next program will clobber my data table. I know I can't make it *impossible*, so "somehwat unlikely" will have to do.

Most booter software doesn't tend to hog every last drop of RAM; so my current idea is to place my table at the top of memory, and reduce the reported memory size in the BIOS Data Area (1K will do) before transferring control to the next program. A reasonably safe approach? Any downsides/other considerations I might be missing?

basically, what every single bootsector virus ever did. technique is well proven :) take the addres that int 0x11 returns, reduce by 1kb at top of ram, your golden.
 
Great, now I can't shake the feeling that VileR is writing a boot virus.
Much more mundane, I'm afraid :) It's simply a booter version of that small TSR I put together for DOS to specify different hsync position values for various CGA modes, because on my CRT TV everything's shifted way too far to the left, and you don't always get those convenient "move screen left/right" controls like some games used to have for situations like this.

(MODE.COM can kinda-sorta fix that under DOS, but even if it wasn't buggy and unreliable, it naturally wouldn't work for booters.)

Oh, c'mon--who in their right might is going to write and distribute a boot sector virus for a 5160 today?
I don't know, but if the media gets wind of this thread we'll have a story about omnipotent Russian haxx0rtrollbots going back in time to retroactively rig the 1984 elections. :p
 
Last edited:
It's simply a booter version of that small TSR I put together for DOS to specify different hsync position values for various CGA modes, because on my CRT TV everything's shifted way too far to the left, and you don't always get those convenient "move screen left/right" controls like some games used to have for situations like this.

Why not just a normal TSR loaded in your autoexec.cfg? Or do you want it tweaking values before the OS even loads?
 
I'd fix the TV...

But the days you need an Arduino, laptop, and 3D printer to do that, I guess.
 
I'd fix the TV...

But the days you need an Arduino, laptop, and 3D printer to do that, I guess.
If that was a TV problem, the snark would be more on point. ;) It's the picture source (CGA) that needs to be configured, which is why much software that was originally written to run on it (even DOS) included the means to do so. Unless they simply didn't have their Arduinos and 3D printers handy...?

My TV's got 99 problems, but the hsync position ain't one.
 
which is why much software that was originally written to run on it (even DOS) included the means to do so.
... and which software would that be? I've sure as shine-ola never come across any CGA software that did that... or software on any computer system that had composite out that offered said adjustments from the computer side of things!

Hence why most dedicated composite monitors had their own adjustment for that.

Do you have a list of programs that offer this because that would be a very interesting topic unto itself. I can't think of or even conceive of any CGA (or other composite computer) software that had what you describe.

If someone had asked me 'cold', I would have been reasonably certain what you are asking for is not a 'thing' outside of the bizzaro-land train-wreck that are X11 config profiles. Where they've had 30+ years and still can't read the VESA config profiles off a modern display properly... but sure that open source fixes problems really fast.
 
Ever use an Amiga? :)

Not with a TV. Hell by the time the Amiga came along people were still connecting computers to TV's? (that's a joke... kind-of...)

Not that I ever got to even see an Amiga for more than like 5 minutes in real life 'back in the day'. They really didn't exist anyplace I was involved in doing computers at the time. (probably because where the {expletive omitted} did you even go to buy one?)

Though as I often said, the main reason Commodore could never break into the business market was their backwards compatibility to TV's limiting them to around 200 scanlines. There's a reason businesses favored MDA/hercules over CGA, and didn't give colour displays the time of day in the mainstream until EGA came along. +4, the 128, even the amiga, they were PAINFUL to work with TEXT on! Even with a real monitor!!! Trash-80 model 1 was better for business at 64x16 when it came to text rendering than anything they made prior to the 128!

Often thought that was a contributing factor to Jobbo the Clown's insistence that 'serious' computers should only ever come in monochrome. One of the many factors (along with his rabid hatred of cooling fans) that led to his being fired from the company he co-founded... explaining why he then went on to found a company who's premier computer had a 17" monochrome display.
 
Last edited:
My point is that every Amiga has the ability to adjust the image height, width, horizonal, and vertical positions.

But I've used Amigas with monochrome monitors; text is very readable. Amigas never broke into the business market because everyone knew how well they played games. Not because they didn't have VGA. There were very capable graphic cards with text as good as anything else, but no one bought them.
 
Last edited:
I meant the graphic cards for Amiga which no one bought. No one bought them because video was built in. These same people that would refuse to buy a graphic card for an Amiga wouldn't balk at buying a cheapo VGA-alike for a PC.
 
... and which software would that be? I've sure as shine-ola never come across any CGA software that did that... or software on any computer system that had composite out that offered said adjustments from the computer side of things!

Hence why most dedicated composite monitors had their own adjustment for that.

Do you have a list of programs that offer this because that would be a very interesting topic unto itself. I can't think of or even conceive of any CGA (or other composite computer) software that had what you describe.
Dedicated composite monitors, yes... but televisions not necessarily.

Quite a few CGA-era titles did let you adjust the screen position. Off the top of my head there were... let's see, some of those Atarisoft booters like Gremlins and Moon Patrol (roll the screen left/right with F9/F10). Most of those early Sierra AGI adventures (Ctrl+Alt+left/right arrow, it's even in the reference card). Some others too, like that old freeware 'BRICKS' game (Vince Bly) which also used the 160x100 pseudo-graphics mode.

And of course there's DOS itself with MODE.COM's ",l" and ",r" parameters... here it's even mentioned that this is specific for CGA so it can "work with a television". (What it fails to mention is that the 6.22 version is so buggy that it's unusable for this purpose, because it enjoys corrupting its own pointers - or is it the interrupt chain's? - so that the next mode-set sends complete garbage to the CRTC.)
 
if the target machine you're running this on is a 386 or better, flopper may be of use to you.
http://www.oldskool.org/pc/flopper

it uses unreal mode and swaps the base 640k out to upper memory as needed. There's also functions to grab a virgin IVT so that a game can hook any interrupt it needs before DOS gets its dirty mitts on it.
 
if the target machine you're running this on is a 386 or better, flopper may be of use to you.
http://www.oldskool.org/pc/flopper

it uses unreal mode and swaps the base 640k out to upper memory as needed. There's also functions to grab a virgin IVT so that a game can hook any interrupt it needs before DOS gets its dirty mitts on it.
Flopper is awesome, and used to be my go-to tool for as long as my main machine could still easily boot into DOS, before Windows went all NT on us. :)
This is for a 5160 however. Happy I got it to work, because booting directly off the floppy is the only way I can run some of those booters that don't have 8088-safe DOS conversions (an unfortunate condition also known as Mok Syndrome).
 
Back
Top