1. allocation of memory

Is their a way to allocate a specific memory address in Eu ?

Can it be determined what address space is free to use in Eu ?

Thasnks Bernie Ryan

new topic     » topic index » view message » categorize

2. Re: allocation of memory

On Sun, 17 Jan 1999 12:02:11 -0500, Bernie Ryan <bwryan at PCOM.NET> wrote:

>Is their a way to allocate a specific memory address in Eu ?
>
>Can it be determined what address space is free to use in Eu ?
>
>Thasnks Bernie Ryan

p = allocate(100) will return an address pointing to 100 bytes
of free memory. The will be available until you do a free()
You can poke machine code into that memory, and call() the
code.
I don't think there is any way to control exactly where that
memory starts, however. Euphoria finds some unused space and
tells you where it is.

Irv

new topic     » goto parent     » topic index » view message » categorize

3. Re: allocation of memory

No I was looking for a way to allocate a specificate location

thanks irv

Bernie Ryan

new topic     » goto parent     » topic index » view message » categorize

4. Re: allocation of memory

> No I was looking for a way to allocate a specificate location
>
> thanks irv
>
> Bernie Ryan

Perhaps you mean to convert a Physical Base Pointer into a Linear mapped
address... (isnt Protected Mode fun?) (not!)

lemme throw some machine code at ya... (this basically just calls an
interrupt, but using dos_interrupt absolutely will not work (dpmi service
calls don't seem to be available using that (Jacques Deschenes might
know more about this)))

constant linaddr = allocate(46)
poke(linaddr, {
    #60,                    --    0: pusha
    #BB,#00,#00,#00,#00,    --    1: mov ebx, PhysBasePtr (2)
    #89,#D9,                --    6: mov ecx, ebx
    #C1,#EB,#10,            --    8: shr ebx, 16
    #BE,#00,#00,#00,#00,    --    B: mov esi, Size (12)
    #89,#F7,                --   10: mov edi, esi
    #C1,#EE,#10,            --   12: shr esi, 16
    #B8,#00,#08,#00,#00,    --   15: mov eax, #800
    #CD,#31,                --   1A: int #31
    #C1,#E3,#10,            --   1C: shl ebx, 16
    #66,#89,#CB,            --   1F: mov bx, cx
    #89,#1D,#E2,#AF,#E4,#82,--   22: mov [@linear], ebx
    #61,                    --   28: popa
    #C3,                    --   29: ret
    #00,#00,#00,#00})       --   2A: linear: dd 0 (42)
poke4(linaddr + 36, linaddr + 42) -- @linear

poke4(linaddr + 2, PhysBasePtr)  ---- you supply these
poke4(linaddr + 12, Size)        -- (size in bytes)

call(linaddr)

your linear address = peek4(linaddr + 42)


What is this good for?  I've used it to get the VESA linear frame buffer,
perhaps it can be used to access other memory mapped devices...

Later dudez,
 _______  ______  _______  ______
[    _  \[    _ ][ _   _ ][    _ ]
[/| [_] |[/| [_\][/ | | \][/| [_\]
  |  ___/  |  _]    | |     |  _]
[\| [/]  [\| [_/] [\| |/] [\| [_/]
[_____]  [______] [_____] [______]
xseal at harborside.com  ICQ:13466657
http://www.harborside.com/home/x/xseal/euphoria/

new topic     » goto parent     » topic index » view message » categorize

5. Re: allocation of memory

>No I was looking for a way to allocate a specificate location


You *can* however, specify wether or not you want to allocate *low* or high*
memory.
And if you already know the exact memory addres, this means, some other
program/part does too. In which case, you dont need to allocate, you can
just poke & peek in that piece of memory.

Euphoria off course, doesnt 'allocate' memory already allocated by another
program.

Ralf

new topic     » goto parent     » topic index » view message » categorize

6. Re: allocation of memory

Thank You for information

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu