|Just another Perl shrine|
Re^2: C-like Pointersby DerHartmut (Novice)
|on Nov 16, 2009 at 03:34 UTC||Need Help??|
Thank you for your answer (and either thank to the others) :D
I know the fact, that C can only access virtual memory, I choosed the easier term "RAM" for people which don't know about Paging and stuff.
My real problem is to solve the following problem:
A buddy wrote a program in C which loads a ELF-kernel and execute it. I (I'm either a C progammer and OS-developer) wanted to write the same program in Perl, just for fun. The biggest problem is to access a virtual address within the process' memoryspace and using pointers to these addresses. I have to write this line:
In Perl. My (not working) solution is:
where syscall() and \&SYS_mmap are functions/references to functions from syscall.h (converted to .ph via h2ph), $kernel_size, $page_read, $map_private and $map_fixed simple integer-values, KERNEL the filehandle to the loaded kernel and $address the pointer to the address.
In short words, I want to do (void*)0x78000000 in Perl, a pointer to a address defiend by myself (without the help of C :-P). I've searched CPAN for XS and pointers but did not found anything related to my problem (or I was too stupid to find it ^^).