![]() ![]() If something doesn't match it will give you the address it didn't match. If the memory is addressed that test will pass and it will move on to read that data and compare it to what it put in. Since this is fairly useless of an app and more of a test I'm not going to fix that.Īfter you provide it an address it starts at that address and writes a 32bit integer to the address, moves to the next address writes an integer 1 larger than the previous. There is no error checking on that so if you enter a non-hex value it will probably crash on that. Next it asks the you for a memory address. ![]() Since the heap is way under 10 MB this allocation request fails which is exactly what it should do. This is using built in system calls for memory. Once loaded it try's to allocated a chunk of memory that is 10 MB in size. When it loads it loads with a heap size between 512K and 1MB. So this app doesn't directly cause harm unless the user enters and address that could corrupt things. So if you put in an address that is mapped to firmware, video card, any other hardware, then it will write some data to it and it very well could break things. The user has control of the memory it accesses. Yes it's easy to crash it (and actually that's part of the intent for what I'm doing with it.Ģ. It's a very crude, basic app with no error checking/handling. I'm going to share it with anyone who want's to play with it, but first some disclaimers.ġ. I have a fun utility/crude app I wrote to do some memory test from with in the OS. I only mention this because hardware is also placed with in the address space accessed by the MMU and you should keep that in mind with the next part.ī. Not sure if OS 9 initializes that differently than OS x or it has something odd to do with maybe it's using a signed int for memory address (that would be odd and not fun to break). I'm still not sure how the hardware MMU plays into this whole thing. If that works then it tells us that the memory is addressable and the potential of some sort of ram disk up there is possible (though not necessarily easy in any way).Ī. So next step is to write a program to put data into memory addresses above the 1.GB limit. Guys what there is nothing (no surprise there). So poking around with MacsBug you can look at what is in the ram above 1.5 gb. Looking at the heaps and stack allocations, the system files are still only taking 30-40 or whatever your system uses depending on extensions and what not.įor MacOS memory usage (which is not handled by the process manager) it takes the total ram installed and subtracts what is allocated to the process manager, and assumes what is left is allocated to the system. When about this mac shows that MacOS takes 540 MB it's actually not really true. Depending on which starts first will be where the ram get's allocated to the process manager. So the os is fully aware at this point of the 2 GB installed. The memory manager I believe starts before the process manager (don't quote me on that as I haven't confirmed this yet). So when the system boots it get's the ram size information from Open Firmware. The heap for the app is then marked as non-executable though on some systems you can override that ins some creative ways.īack on track though. ![]() With protected memory apps are usually given a virtual address space so it thinks it starts at address 0 the os then translate that to physical addresses. Because os 9 does not have protected memory you can write apps that pretty much read anything. Once the process manager starts it claims the rest of the memory for it's heap except for a little bit at the top which it is allocated for it's stack.įor those of you who don't know, the heap is the working memory where your data is stored and the stack is the memory where the actually executable code is stored. So using an iBook with 320 MB of ram I found that the system heap and stack along with some rom space and some other system stuff sits at the bottom of ram (starting at or around address 00002800). I've posted elsewhere some theory's I had while examining memory. DieHard pointed the out to me and directed me towards this discussion Then you go to about this mac and you see that hey the system recognizes that there is 2GB of ram!!! And you get all excited until you notice that Mac OS takes up 512-540 MB (give or take) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |