Is there a DOS memory documentation available? (Users)
> /E enables moving of EBDA (Extended BIOS Data Area), optionally a size in
> kilobytes may be specified [xxx, in range of 48-1024]
Documentation about SWITCHES=/E:nnnn could indeed be better. The size is specified in bytes, not in kilobytes. The size has to be a multiple of 16 bytes and at least 48 bytes, so the kernel rounds up the value you specify to the next multiple of 16. Example values:
/* allowed values: [48..1024] bytes, multiples of 16
* e.g. AwardBIOS: 48, AMIBIOS: 1024
* (Phoenix, MRBIOS, Unicore = ????)
*/
...
if (n >= 48 && n <= 1024) ...
Config.ebda2move = (n + 15) & 0xfff0;
The EBDA is not code, it is data. Relevant code is in DoConfig and PreConfig2. If you do not specify /E:nnnn, the kernel will calculate the size in kilobytes based on BIOS data about EBDA segment and amount of low RAM (which is at most 640k). If you do specify /E:nnnn, it will cap the size to your specified amount of bytes, at most 1 kB, at your own risk.
unsigned ebdasize(void)
{
unsigned ebdaseg = peek(0, EBDASEG);
unsigned ramsize = ram_top;
if (ramsize == peek(0, RAMSIZE))
if (ramsize * 64 == ebdaseg && ramsize < 640 && peek(0, RAMSIZE) == ramsize)
{
unsigned ebdasz = peekb(ebdaseg, 0);
/* sanity check: is there really no more than 63 KB?
* must be at 640k (all other values never seen and are untested)
*/
if (ebdasz <= 63 && ramsize + ebdasz == 640)
return ebdasz * 1024U;
}
return 0;
}
Because EBDA is supposed to be data, the kernel can move it to other places, possibly in UMB (or HMA?) simply by copying it around and updating the EBDA segment value somewhere at 40:xx similar to updating a pointer.
If you see far less than 640k of RAM, you may have some code or data buffers at the end of your 640k. The kernel can NOT move those around. Think about MBR -based drivers for supporting harddisks larger than 504 MB or 8 GB if your BIOS is too old. Also think about viruses and maybe buffers of exotic network or disk controller ROMs.
You probably should not use the /E switch most of the time. The kernel can autodetect the size and you save less than 1 kB by manually specifying the size if the autodetected size was 1 kB. For other sizes, the kernel cannot help you. I think you can also specify size -1 or size 0 for special cases such as "autodetect" or "do not touch EBDA".
---
FreeDOS / DOSEMU2 / ...
Complete thread:
- Is there a DOS memory documentation available? - fritz.mueller, 07.01.2024, 21:20 (Users)
- Is there a DOS memory documentation available? - SuperIlu, 08.01.2024, 00:35
- Is there a DOS memory documentation available? - mceric, 08.01.2024, 00:58
- Is there a DOS memory documentation available? - Rugxulo, 08.01.2024, 09:46
- Is there a DOS memory documentation available? - marcov, 08.01.2024, 22:40
- Is there a DOS memory documentation available? - tauro, 18.01.2024, 06:22
- Is there a DOS memory documentation available? - mceric, 18.01.2024, 10:47
- Is there a DOS memory documentation available? - Rugxulo, 19.01.2024, 01:25
- Is there a DOS memory documentation available? - mceric, 19.01.2024, 10:42
- Is there a DOS memory documentation available? - Japheth, 19.01.2024, 11:57
- Is there a DOS memory documentation available? - ecm, 19.01.2024, 16:42
- Is there a DOS memory documentation available? - mceric, 19.01.2024, 18:02
- Is there a DOS memory documentation available? - mceric, 19.01.2024, 10:42
- Is there a DOS memory documentation available? - Rugxulo, 19.01.2024, 01:25
- Is there a DOS memory documentation available? - mceric, 18.01.2024, 10:47
- Is there a DOS memory documentation available? - Rugxulo, 08.01.2024, 09:46
- Is there a DOS memory documentation available? - bretjohn, 08.01.2024, 18:17
- Is there a DOS memory documentation available? - fritz.mueller, 08.01.2024, 20:30
- Is there a DOS memory documentation available? - tom, 08.01.2024, 21:20
- Is there a DOS memory documentation available? - marcov, 08.01.2024, 23:22
- Is there a DOS memory documentation available? - ecm, 09.01.2024, 00:00
- Is there a DOS memory documentation available? - bretjohn, 09.01.2024, 01:03
- Is there a DOS memory documentation available? - ecm, 09.01.2024, 09:38
- Is there a DOS memory documentation available? - bretjohn, 09.01.2024, 17:35
- Is there a DOS memory documentation available? - Oso2k, 09.01.2024, 20:09
- Is there a DOS memory documentation available? - fritz.mueller, 09.01.2024, 22:21
- Is there a DOS memory documentation available? - Zyzzle, 10.01.2024, 04:47
- Is there a DOS memory documentation available? - mceric, 10.01.2024, 11:56
- Is there a DOS memory documentation available? - ecm, 10.01.2024, 21:14
- Is there a DOS memory documentation available? - bretjohn, 12.01.2024, 04:42
- Is there a DOS memory documentation available? - ecm, 12.01.2024, 18:00
- Is there a DOS memory documentation available? - bretjohn, 12.01.2024, 04:42
- Is there a DOS memory documentation available? - ecm, 10.01.2024, 21:14
- Is there a DOS memory documentation available? - mceric, 10.01.2024, 11:56
- Is there a DOS memory documentation available? - Zyzzle, 10.01.2024, 04:47
- Is there a DOS memory documentation available? - fritz.mueller, 09.01.2024, 22:21
- Is there a DOS memory documentation available? - Oso2k, 09.01.2024, 20:09
- Is there a DOS memory documentation available? - bretjohn, 09.01.2024, 17:35
- Is there a DOS memory documentation available? - ecm, 09.01.2024, 09:38
- Is there a DOS memory documentation available? - marcov, 09.01.2024, 09:42
- Is there a DOS memory documentation available? - bretjohn, 09.01.2024, 01:03
- Is there a DOS memory documentation available? - ecm, 09.01.2024, 00:00
- Is there a DOS memory documentation available? - fritz.mueller, 08.01.2024, 20:30
- Is there a DOS memory documentation available? - boeckmann, 19.01.2024, 10:09