Ask a Question related to Mac Programming, Design and Development.
-
James Weatherley #1
Allocating memory starting at 0x00000000
I want to allocate a bunch of memory starting from address 0x00000000
using mmap() or vm_allocate() on OS X 10.2. By default apps don't allow
this to protect against NULL pointer mischief - how do I change things
so that I can map this memory?
So far I've discovered it is the linker that is stopping me - it inserts
a no access block called __PAGEZERO in the zeroth page and other stuff
such as a __TEXT block and the actual executable code follows shortly
thereafter. I figured out how to link the program so that it loaded
itself in at 0x10000000 instead using -seg1addr but it still puts in
__PAGEZERO.
Even then I can't seem to map any memory below about 0x000A4000. I was
expecting to be able to start from 0x00001000 with just __PAGEZERO in
the low pages. What's else is stopping me?
So in short what else (if anything) apart from __PAGEZERO is thwarting
me and if anyone does know how to map in a block of memory starting at
0x00000000 please tell me the secret!
Cheers
James
James Weatherley Guest
-
Out-of-Memory Error - Acrobat Professional7.0.8 - But there is plenty of memory?
Support / Forums / Anybody, Has anyone experienced problems running Adobe Acrobat Professional Version 7.0.8 along with Pitstop 6.53? Currently I... -
Flash Player 8 huge memory using during drag (all memory gone in few minutes) !!!
Hi, my name is Ladislav Sopko and I am the project manager for our mapping solution MapWorld. MapWorld is a dynamic flash based cartographic... -
Allocating memory
trying to allocate more memory to internet explorer. i have mac os9 "the missing manual" book. following instructions on pg.116, when i go to "get... -
Memory consumption of Ruby/mod_ruby combo on Apache [memory leak]
> I don't think so - I think all the modules are loaded when Apache is It didn't have anything to do with IfModules or even Apache. I had a... -
AspNet Process Memory Issue on Win2k Server - Peformance is fine - Memory usuage doesn't stop growing
We are running our company website on a win2k server running .NET framework 1.0 and IIS 5. The pages consist of mostly static content built from a... -
David Phillip Oster #2
Re: Allocating memory starting at 0x00000000
In article <MPG.19aad44f6fc09d2e98968f@News.Individual.NET> ,
James Weatherley <news@weatherley.net> wrote:
Open a terminal window and read up on "ld" (% man ld). You can map a> I want to allocate a bunch of memory starting from address 0x00000000
> using mmap() or vm_allocate() on OS X 10.2. By default apps don't allow
> this to protect against NULL pointer mischief - how do I change things
> so that I can map this memory?
read-write segment at location 0 in your "ld" command line, if you want
to, using gcc.
David Phillip Oster Guest
-
JamesW #3
Re: Allocating memory starting at 0x00000000
In <oster-CF1A45.22573018082003@news.sf.sbcglobal.net> David Phillip
Oster wrote:Yes, I've been looking at the ld man pages - that's where I found out> In article <MPG.19aad44f6fc09d2e98968f@News.Individual.NET> ,
> James Weatherley <news@weatherley.net> wrote:
>>>> I want to allocate a bunch of memory starting from address 0x00000000
>> using mmap() or vm_allocate() on OS X 10.2. By default apps don't
>> allow this to protect against NULL pointer mischief - how do I
>> change things so that I can map this memory?
> Open a terminal window and read up on "ld" (% man ld). You can map a
> read-write segment at location 0 in your "ld" command line, if you
> want to, using gcc.
>
about __PAGEZERO. I still can't work out what flags I need. '-segs_read_
write_addr addr and '-segs_read_only_addr addr' seemed hopeful but they
only apply if you are using the '-dylib' option but I want an executable.
JamesW Guest
-
James Weatherley #4
Re: Allocating memory starting at 0x00000000
In article <3F487055.1334A9C6@nospam.idiom.com>, [email]jcr@nospam.idiom.com[/email]
says...I'm porting a Sinclair QL emulator uQLx to OS X - [url]http://www.dokos-[/url]> James Weatherley wrote:>> >
> > I want to allocate a bunch of memory starting from address 0x00000000
> > using mmap() or vm_allocate() on OS X 10.2. By default apps don't allow
> > this to protect against NULL pointer mischief - how do I change things
> > so that I can map this memory?
> Why do you need to do this?
>
> -jcr
>
gr.net/ql/uqlxmac.html. As you can see I can get it running but the
original version has some performance enhancements that would be nice to
have in the Mac version. One of these is basing the emulated machine's
memory at 0x00000000 to save some pointer arithmetic every time the
emulated machine needs to access memory (ie all the time!). The author
claims a 20-30% speed boost on UNICES that allow this.
James
James Weatherley Guest
-
Eric Albert #5
Re: Allocating memory starting at 0x00000000
In article <MPG.19b534bd54bd7402989690@News.Individual.NET> ,
James Weatherley <news@weatherley.net> wrote:
> In article <3F487055.1334A9C6@nospam.idiom.com>, [email]jcr@nospam.idiom.com[/email]
> says...> > James Weatherley wrote:> >> > >
> > > I want to allocate a bunch of memory starting from address 0x00000000
> > > using mmap() or vm_allocate() on OS X 10.2. By default apps don't allow
> > > this to protect against NULL pointer mischief - how do I change things
> > > so that I can map this memory?
> > Why do you need to do this?Without reading anything about it, the degree of that speed boost sounds> I'm porting a Sinclair QL emulator uQLx to OS X - [url]http://www.dokos-[/url]
> gr.net/ql/uqlxmac.html. As you can see I can get it running but the
> original version has some performance enhancements that would be nice to
> have in the Mac version. One of these is basing the emulated machine's
> memory at 0x00000000 to save some pointer arithmetic every time the
> emulated machine needs to access memory (ie all the time!). The author
> claims a 20-30% speed boost on UNICES that allow this.
very odd. You save one or two instructions per memory access, but
that's more than dwarfed by the high cost of accessing memory. I can't
see how that'd lead to a 20-30% performance improvement.
-Eric
--
Eric Albert [email]ejalbert@stanford.edu[/email]
[url]http://rescomp.stanford.edu/~ejalbert/[/url]
Eric Albert Guest



Reply With Quote

