interfacing - How to interface a memory hardware to a C++ program? -


If I have a special hardware unit with some storage that is connected to the computer and is a memory map, its storage address Category 0x55500000 is accessible in 0x555fffff How do I interface this hardware unit in my C ++ program so that dynamic memory is allocated in this hardware unit, not in memory of my computer? I need to implement the class in which it has the following function.

  Zero * allocMemoryInMyHardware (Int NumberoffBets TouAllocate);   

which assigns the pointer to the allocated memory chuck, or if it is unable to allocate

You have to write your own allocation, search the Internet for a sample code and zoom it if you have simple requirements, the basic allocation can be written from scratch in 2-4 hours. This approach will work if your platform does not have virtual memory management and the code can directly access the boundary of your address otherwise you need to plunge into the development of the driver on your platform.

Typical strategy is to add headers to each assigned unit and organize a double-linked list for free memory areas. NT heap work in the same way.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -