I'm having trouble compiling the direct-probing function that determines installed memory on the FAQ's part of this site. I'm using DJGPP. Here's the errors I'm getting:
system.c: In function `Get_Memory':
system.c:63: parse error before `:'
system.c:71: parse error before `:'
system.c:107: parse error before `:'
Line 63: __asm__ __volatile("movl %%cr0, %%eax":"=a"(cr0))::"eax");
Line 71: __asm__ __volatile__("movl %%eax, %%cr0", :: "a" (cr0 | 0x00000001 | 0x40000000 | 0x20000000) : "eax");
Line 107: __asm__ __volatile__("movl %%eax, %%cr0", :: "a" (cr0) : "eax");
Has anyone else received these errors? Please help.
Error with Count Memory function in FAQs
Re: Error with Count Memory function in FAQs
gcc / gas has a habit of breaking inline asm every version. its a pain in the @$$.
also, the direct probing is REALLY BAD way to detect memory. stick to using the BIOS or motherboard chipset functionality.
its a bad way to just bomb values into the memory.. PCI cards, etc, map to high memory, etc...
if your using GRUB as a loader, stick to the values it returns.
also, the direct probing is REALLY BAD way to detect memory. stick to using the BIOS or motherboard chipset functionality.
its a bad way to just bomb values into the memory.. PCI cards, etc, map to high memory, etc...
if your using GRUB as a loader, stick to the values it returns.
-- Stu --