[Patch]Memory setting patch

Discussion of development and patch submission.
Post Reply
Greatpsycho
Posts: 151
Joined: Tue 22 Mar, 2016 10:03 am
Location: Korea
Contact:

[Patch]Memory setting patch

Post by Greatpsycho »

This patch does the following

- Rewritten IBM AT & PS/2 series top 256k/384k mapping logic. No more 384kb of extra memory allocation needed.
- IBM AT now can have less than 1MB memory.
Attachments
memory_patch.tar.gz
Memory setting patch.
(3.24 KiB) Downloaded 326 times
User avatar
ppgrainbow
Posts: 479
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: [Patch]Memory setting patch

Post by ppgrainbow »

Great work on the memory settings patch!

Can this setting be applied to 286, 386 and 386SX clones? I know for a fact that the IBM PS/1 Model 2011 started out with 512 KB of base memory.
Greatpsycho
Posts: 151
Joined: Tue 22 Mar, 2016 10:03 am
Location: Korea
Contact:

Re: [Patch]Memory setting patch

Post by Greatpsycho »

ppgrainbow wrote:Great work on the memory settings patch!

Can this setting be applied to 286, 386 and 386SX clones? I know for a fact that the IBM PS/1 Model 2011 started out with 512 KB of base memory.
Yes. I've just added if AT machines granularity value less than 128, consider memory size is MB and greater or equal than 128, consider memory size is KB.

And additional patch attached below applies PS/1 2011, AMI 286 clone, Award 286 clone and DTK 386SX clone can have less than 1MB memory.
Attachments
model.c.patch
Additional memory setting patch against previous patch,
(4.87 KiB) Downloaded 304 times
User avatar
ppgrainbow
Posts: 479
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: [Patch]Memory setting patch

Post by ppgrainbow »

Greatpsycho wrote:
ppgrainbow wrote:Great work on the memory settings patch!

Can this setting be applied to 286, 386 and 386SX clones? I know for a fact that the IBM PS/1 Model 2011 started out with 512 KB of base memory.
Yes. I've just added if AT machines granularity value less than 128, consider memory size is MB and greater or equal than 128, consider memory size is KB.

And additional patch attached below applies PS/1 2011, AMI 286 clone, Award 286 clone and DTK 386SX clone can have less than 1MB memory.
Awesome! I'm wondering if it's possible to apply this patch to AMI 386SX/386DX clone as well as the Commodore PC 30 III and Dell System 200 machines as well! :)
Greatpsycho
Posts: 151
Joined: Tue 22 Mar, 2016 10:03 am
Location: Korea
Contact:

Re: [Patch]Memory setting patch

Post by Greatpsycho »

ppgrainbow wrote:
Greatpsycho wrote:
ppgrainbow wrote:Great work on the memory settings patch!

Can this setting be applied to 286, 386 and 386SX clones? I know for a fact that the IBM PS/1 Model 2011 started out with 512 KB of base memory.
Yes. I've just added if AT machines granularity value less than 128, consider memory size is MB and greater or equal than 128, consider memory size is KB.

And additional patch attached below applies PS/1 2011, AMI 286 clone, Award 286 clone and DTK 386SX clone can have less than 1MB memory.
Awesome! I'm wondering if it's possible to apply this patch to AMI 386SX/386DX clone as well as the Commodore PC 30 III and Dell System 200 machines as well! :)
It's easy job. Please let me know what machines have less than 1MB memory when it ls released.
User avatar
ppgrainbow
Posts: 479
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: [Patch]Memory setting patch

Post by ppgrainbow »

Greatpsycho wrote:
ppgrainbow wrote:
Greatpsycho wrote:
Yes. I've just added if AT machines granularity value less than 128, consider memory size is MB and greater or equal than 128, consider memory size is KB.

And additional patch attached below applies PS/1 2011, AMI 286 clone, Award 286 clone and DTK 386SX clone can have less than 1MB memory.
Awesome! I'm wondering if it's possible to apply this patch to AMI 386SX/386DX clone as well as the Commodore PC 30 III and Dell System 200 machines as well! :)
It's easy job. Please let me know what machines have less than 1MB memory when it ls released.
OKay! :D

Most 386SX and 386DX-based motherboards had as little as 512 KB of base RAM.

I believe that the Commodore PC 30 III was released in 1988 and it was configured with either 512 KB or 640 KB of RAM: http://www.homecomputer.de/pages/Machin ... 0_III.html

I also believe that the Dell System 200 came with 640 KB of RAM according to a August 1988 PC Magazine article: https://books.google.com/books?id=ObYbl ... KB&f=false

A 512 KB upgrade kit brought the memory for the Dell System 200 to 1,152 KB (640 KB base and 512 KB extended).
Greatpsycho
Posts: 151
Joined: Tue 22 Mar, 2016 10:03 am
Location: Korea
Contact:

Re: [Patch]Memory setting patch

Post by Greatpsycho »

ppgrainbow wrote:
Greatpsycho wrote:
ppgrainbow wrote:
Awesome! I'm wondering if it's possible to apply this patch to AMI 386SX/386DX clone as well as the Commodore PC 30 III and Dell System 200 machines as well! :)
It's easy job. Please let me know what machines have less than 1MB memory when it ls released.
OKay! :D

Most 386SX and 386DX-based motherboards had as little as 512 KB of base RAM.

I believe that the Commodore PC 30 III was released in 1988 and it was configured with either 512 KB or 640 KB of RAM: http://www.homecomputer.de/pages/Machin ... 0_III.html

I also believe that the Dell System 200 came with 640 KB of RAM according to a August 1988 PC Magazine article: https://books.google.com/books?id=ObYbl ... KB&f=false

A 512 KB upgrade kit brought the memory for the Dell System 200 to 1,152 KB (640 KB base and 512 KB extended).
Additional patch attached below applies
- PS/1 2011, AMI 286 clone, Award 286 clone, DTK 386SX clone, Commodore PC30 III, Dell System 200 and AMI 386SX clone can have less than 1MB memory.
- Changed IBM PC's memory granularity value to 32KB.

This patch replaces previous patch.
Attachments
model.c.patch
Additional memory setting patch against first attatched patch,
(7.58 KiB) Downloaded 297 times
User avatar
ppgrainbow
Posts: 479
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: [Patch]Memory setting patch

Post by ppgrainbow »

Greatpsycho wrote:
ppgrainbow wrote:
Greatpsycho wrote:
It's easy job. Please let me know what machines have less than 1MB memory when it ls released.
OKay! :D

Most 386SX and 386DX-based motherboards had as little as 512 KB of base RAM.

I believe that the Commodore PC 30 III was released in 1988 and it was configured with either 512 KB or 640 KB of RAM: http://www.homecomputer.de/pages/Machin ... 0_III.html

I also believe that the Dell System 200 came with 640 KB of RAM according to a August 1988 PC Magazine article: https://books.google.com/books?id=ObYbl ... KB&f=false

A 512 KB upgrade kit brought the memory for the Dell System 200 to 1,152 KB (640 KB base and 512 KB extended).
Additional patch attached below applies
- PS/1 2011, AMI 286 clone, Award 286 clone, DTK 386SX clone, Commodore PC30 III, Dell System 200 and AMI 386SX clone can have less than 1MB memory.
- Changed IBM PC's memory granularity value to 32KB.

This patch replaces previous patch.
Awesome work so far! :D

I've hear that IBM PCs can go down to as little as just 16 KB!
Greatpsycho
Posts: 151
Joined: Tue 22 Mar, 2016 10:03 am
Location: Korea
Contact:

Re: [Patch]Memory setting patch

Post by Greatpsycho »

ppgrainbow wrote:
Greatpsycho wrote:
ppgrainbow wrote: OKay! :D

Most 386SX and 386DX-based motherboards had as little as 512 KB of base RAM.

I believe that the Commodore PC 30 III was released in 1988 and it was configured with either 512 KB or 640 KB of RAM: http://www.homecomputer.de/pages/Machin ... 0_III.html

I also believe that the Dell System 200 came with 640 KB of RAM according to a August 1988 PC Magazine article: https://books.google.com/books?id=ObYbl ... KB&f=false

A 512 KB upgrade kit brought the memory for the Dell System 200 to 1,152 KB (640 KB base and 512 KB extended).
Additional patch attached below applies
- PS/1 2011, AMI 286 clone, Award 286 clone, DTK 386SX clone, Commodore PC30 III, Dell System 200 and AMI 386SX clone can have less than 1MB memory.
- Changed IBM PC's memory granularity value to 32KB.

This patch replaces previous patch.
Awesome work so far! :D

I've hear that IBM PCs can go down to as little as just 16 KB!
But due to IBM PC's BIOS bug, IBM PC's memory setting should be at least 64KB now.
User avatar
ppgrainbow
Posts: 479
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: [Patch]Memory setting patch

Post by ppgrainbow »

Greatpsycho wrote:
ppgrainbow wrote:
Greatpsycho wrote:
Additional patch attached below applies
- PS/1 2011, AMI 286 clone, Award 286 clone, DTK 386SX clone, Commodore PC30 III, Dell System 200 and AMI 386SX clone can have less than 1MB memory.
- Changed IBM PC's memory granularity value to 32KB.

This patch replaces previous patch.
Awesome work so far! :D

I've hear that IBM PCs can go down to as little as just 16 KB!
But due to IBM PC's BIOS bug, IBM PC's memory setting should be at least 64KB now.
Thanks for telling me. Let's not forget about allowing the Compaq Deskpro 386 and the Amstrad Mega PC to have less than 1 MB of memory and remapping the memory also. :p
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch]Memory setting patch

Post by SarahWalker »

Committed at rev 772. I made a few changes :
- Commodore PC 30 III has 640kb minimum, as the real machine appears to have tbat much soldered to the motherboard
- PS/1 model 2011 granularity is now 512kb, as memory expansions don't seem to exist in finer granularity than that
- Fixed some issues in the memory remapping code, largely when only 128kb or 256kb of extended memory is available to be remapped.
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch]Memory setting patch

Post by SarahWalker »

ppgrainbow wrote:I've hear that IBM PCs can go down to as little as just 16 KB!
This is possible, however you can't use DOS with less than 64kb. As PCem doesn't emulate the cassette interface adding a 16kb option would be pretty useless.
ppgrainbow wrote:Thanks for telling me. Let's not forget about allowing the Compaq Deskpro 386 and the Amstrad Mega PC to have less than 1 MB of memory and remapping the memory also. :p
Compaq Deskpro 386 looks to have had 1 MB minimum; it used custom memory boards, and I don't think they existed below 1MB. MegaPC also shipped with 1 MB minimum, though in that case it _may_ have been possible to run it with less (assuming the BIOS doesn't require shadow RAM to be available); but why bother?
User avatar
ppgrainbow
Posts: 479
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: [Patch]Memory setting patch

Post by ppgrainbow »

SarahWalker wrote:
ppgrainbow wrote:I've hear that IBM PCs can go down to as little as just 16 KB!
This is possible, however you can't use DOS with less than 64kb. As PCem doesn't emulate the cassette interface adding a 16kb option would be pretty useless.
ppgrainbow wrote:Thanks for telling me. Let's not forget about allowing the Compaq Deskpro 386 and the Amstrad Mega PC to have less than 1 MB of memory and remapping the memory also. :p
Compaq Deskpro 386 looks to have had 1 MB minimum; it used custom memory boards, and I don't think they existed below 1MB. MegaPC also shipped with 1 MB minimum, though in that case it _may_ have been possible to run it with less (assuming the BIOS doesn't require shadow RAM to be available); but why bother?
Let's not forget that the IBM PS/1 Model 2121 shipped with 2 MB RAM minimum and can go up to 6 MB RAM maximum in 2 MB increments. Pentium motherboards will eventually need to have 4 MB RAM minimum in 4 MB increments too. :)
User avatar
ppgrainbow
Posts: 479
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: [Patch]Memory setting patch

Post by ppgrainbow »

SarahWalker wrote:
ppgrainbow wrote:I've hear that IBM PCs can go down to as little as just 16 KB!
This is possible, however you can't use DOS with less than 64kb. As PCem doesn't emulate the cassette interface adding a 16kb option would be pretty useless.
ppgrainbow wrote:Thanks for telling me. Let's not forget about allowing the Compaq Deskpro 386 and the Amstrad Mega PC to have less than 1 MB of memory and remapping the memory also. :p
Compaq Deskpro 386 looks to have had 1 MB minimum; it used custom memory boards, and I don't think they existed below 1MB. MegaPC also shipped with 1 MB minimum, though in that case it _may_ have been possible to run it with less (assuming the BIOS doesn't require shadow RAM to be available); but why bother?
Let's not forget that the IBM PS/1 Model 2121 shipped with 2 MB RAM minimum and can go up to 6 MB RAM maximum in 2 MB increments. Pentium motherboards will eventually need to have 4 MB RAM minimum in 4 MB increments too. :)

By the way, thank you for patching up several 286 and 386SX emulated machines!
Last edited by ppgrainbow on Mon 19 Jun, 2017 4:14 am, edited 1 time in total.
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: [Patch]Memory setting patch

Post by Battler »

This patch breaks the Pentium machines. For example, Intel Advanced/EV now hangs at POST. I really don't think all AT-class machines with IDE should have the top 384 kB remapped.

Edit: After moving the top 384 kB remap from the AT+IDE init routine to the init routines for AT NEAT, AT SCAT, and AT Headland, the Pentium machines work again.
Greatpsycho
Posts: 151
Joined: Tue 22 Mar, 2016 10:03 am
Location: Korea
Contact:

Re: [Patch]Memory setting patch

Post by Greatpsycho »

Battler wrote:This patch breaks the Pentium machines. For example, Intel Advanced/EV now hangs at POST. I really don't think all AT-class machines with IDE should have the top 384 kB remapped.
You're right. Remapping top 384k memory should be applied only no shadowram support machine like IBM AT or AT compatible machine that uses Chips & Technologies 82C201/82C202 chipset so mem_remap_top_384k() statement in at_ide_init() function must be removed like below.

Code: Select all

void at_ide_init()
{
        at_init();
        ide_init();
//        mem_remap_top_384k(); // This line should be removed.
}
Edit: After moving the top 384 kB remap from the AT+IDE init routine to the init routines for AT NEAT, AT SCAT, and AT Headland, the Pentium machines work again.
mem_remap_top_384k() should not be called AT NEAT, AT SCAT, AT Headland chipset initialization because that chipsets support shadow ram and can alter memory remapping feature via chipset-spectific register. But in PCem, only AT SCAT chipset's memory remapping feature is implemeted now.
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch]Memory setting patch

Post by SarahWalker »

I'm confused now. at_ide_init() is only used by the Commodore PC 30 III, and is never called on any of the Pentium machines or indeed any other machine at all. It's badly named, but is NOT a generic function for AT+IDE.

I've also just tried the Advanced/EV, and it's working fine...
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: [Patch]Memory setting patch

Post by Battler »

This is what happens when I apply a commit from Sarah the wrong way (by making all AT+IDE boards use at_ide_init()) and then apply this commit here. So yeah, I apologize for the false report, it's just a case of situation normal: I messed up. :p
User avatar
ppgrainbow
Posts: 479
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: [Patch]Memory setting patch

Post by ppgrainbow »

Speaking of the Commodore PC 30 III, when I select 1,024 KB RAM, the BIOS reports only 640 KB of memory usable. If I select 1,408 KB RAM, the BIOS will report 384 KB of extended memory usable.

And at least 1,408 KB of RAM is needed to run Windows 3.0 in Standard Mode. If 1,024 KB RAM is selected, Windows 3.0 will only run in Real Model due to the 384 KB of extended memory not being remapped.
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch]Memory setting patch

Post by SarahWalker »

Seems to be working here...
Greatpsycho
Posts: 151
Joined: Tue 22 Mar, 2016 10:03 am
Location: Korea
Contact:

Re: [Patch]Memory setting patch

Post by Greatpsycho »

ppgrainbow wrote:Speaking of the Commodore PC 30 III, when I select 1,024 KB RAM, the BIOS reports only 640 KB of memory usable. If I select 1,408 KB RAM, the BIOS will report 384 KB of extended memory usable.

And at least 1,408 KB of RAM is needed to run Windows 3.0 in Standard Mode. If 1,024 KB RAM is selected, Windows 3.0 will only run in Real Model due to the 384 KB of extended memory not being remapped.
I've selected 1024KB RAM, the BIOS reports 640KB conventional memory and total 1024KB memory and no problem to use 384KB extended memory.
1.png
1.png (17.61 KiB) Viewed 14031 times
2.png
2.png (18.21 KiB) Viewed 14031 times
3.png
3.png (16.48 KiB) Viewed 14031 times
Post Reply