[Patch]Memory setting patch

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

[Patch]Memory setting patch

Postby Greatpsycho » Thu 15 Jun, 2017 8:42 am

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 21 times
User avatar
ppgrainbow
Posts: 402
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: [Patch]Memory setting patch

Postby ppgrainbow » Thu 15 Jun, 2017 5:22 pm

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: 88
Joined: Tue 22 Mar, 2016 10:03 am
Location: Korea
Contact:

Re: [Patch]Memory setting patch

Postby Greatpsycho » Fri 16 Jun, 2017 2:09 am

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 13 times
User avatar
ppgrainbow
Posts: 402
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: [Patch]Memory setting patch

Postby ppgrainbow » Fri 16 Jun, 2017 2:23 am

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: 88
Joined: Tue 22 Mar, 2016 10:03 am
Location: Korea
Contact:

Re: [Patch]Memory setting patch

Postby Greatpsycho » Fri 16 Jun, 2017 3:51 am

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: 402
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: [Patch]Memory setting patch

Postby ppgrainbow » Fri 16 Jun, 2017 4:18 am

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: 88
Joined: Tue 22 Mar, 2016 10:03 am
Location: Korea
Contact:

Re: [Patch]Memory setting patch

Postby Greatpsycho » Fri 16 Jun, 2017 6:16 am

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 16 times
User avatar
ppgrainbow
Posts: 402
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: [Patch]Memory setting patch

Postby ppgrainbow » Fri 16 Jun, 2017 7:40 am

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: 88
Joined: Tue 22 Mar, 2016 10:03 am
Location: Korea
Contact:

Re: [Patch]Memory setting patch

Postby Greatpsycho » Fri 16 Jun, 2017 7:45 am

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: 402
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: [Patch]Memory setting patch

Postby ppgrainbow » Fri 16 Jun, 2017 3:31 pm

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
SarahWalker
Site Admin
Posts: 1327
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch]Memory setting patch

Postby SarahWalker » Sun 18 Jun, 2017 7:32 pm

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.
SarahWalker
Site Admin
Posts: 1327
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch]Memory setting patch

Postby SarahWalker » Sun 18 Jun, 2017 7:37 pm

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: 402
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: [Patch]Memory setting patch

Postby ppgrainbow » Sun 18 Jun, 2017 9:14 pm

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: 402
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: [Patch]Memory setting patch

Postby ppgrainbow » Sun 18 Jun, 2017 9:38 pm

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

Postby Battler » Mon 19 Jun, 2017 3:55 am

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: 88
Joined: Tue 22 Mar, 2016 10:03 am
Location: Korea
Contact:

Re: [Patch]Memory setting patch

Postby Greatpsycho » Mon 19 Jun, 2017 4:36 am

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.
SarahWalker
Site Admin
Posts: 1327
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch]Memory setting patch

Postby SarahWalker » Mon 19 Jun, 2017 5:21 pm

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

Postby Battler » Mon 19 Jun, 2017 7:05 pm

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: 402
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: [Patch]Memory setting patch

Postby ppgrainbow » Mon 19 Jun, 2017 7:31 pm

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.
SarahWalker
Site Admin
Posts: 1327
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch]Memory setting patch

Postby SarahWalker » Mon 19 Jun, 2017 7:47 pm

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

Re: [Patch]Memory setting patch

Postby Greatpsycho » Tue 20 Jun, 2017 4:09 am

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 913 times

2.png
2.png (18.21 KiB) Viewed 913 times

3.png
3.png (16.48 KiB) Viewed 913 times

Return to “Development”

Who is online

Users browsing this forum: No registered users and 2 guests