2003-06-26 02:31 AM
2003-06-25 11:14 PM
We have an application without screen (pure embedded box)
The default BIOS settings create a 4Mbytes frame buffer (we have no way to modify this BIOS and we can't enter BIOS settings manually for each box). We're running VxWorks (out from DRAM memory once loaded) and we would like to set the frame buffer size to 0 at the very beginning of VxWorks boot to get back the 4Mbytes of DRAM. To do this we just write 0 into GRAPH_MEM register (offset 0x36 accessed via register 0x22) sysOutByte(STPC_INDEX, GRAPH_MEM_OFFSET); sysOutByte(STPC_DATA, sysInByte(STPC_DATA) & 0xC0); // frame buffer size = 0 ; 2 upper bits reserved BUT this hangs the machine. If there a solution to this problem (we want to modify DRAM settings from code running out of DRAM)? Are there other register to re-initialize (DRAM controller, ...) ? Many thanks for a reply2003-06-26 02:31 AM
When you modify the size of the frame buffer, you also modify the position of the system memory inside the DRAM (the frame buffer is stored at the beginning of the DRAM). All the memory addresses seen by the CPU are modified with an offset, the data at address 0 will be seen at 4Mb after the change.
In practice, your code have to be outside the DRAM or have to be duplicate into memory at the two location, before and after the change. You also need to adjust the address of all your data... including the stack. It means re-adjust the ss segment before to access any local variable or before to leave a function and re-adjust the data segments before to access any global variables. You also need to be very carefull if your code use far jump. All this have to be done in assembly language as the segments and the GDT are not accessible from C. You also need to be in protected mode to be able to access the 4Mb addresses. The BIOS is booting in real-mode. If you are not familiar with x86 CPUs and with assembly language, I suggest to try to modify the default value of the BIOS by contacting your BIOS vendor. It will be easier. Farfalla