All of lore.kernel.org
 help / color / mirror / Atom feed
* Regarding virtual to physical memory mapping..
@ 2009-12-31 12:15 kiran pawar
  2009-12-31 12:31 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 5+ messages in thread
From: kiran pawar @ 2009-12-31 12:15 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 626 bytes --]

Hi all,
    I am working on grub-1.97.1. I wanted to know if there is any mechanism
in grub2 that maps virtual addresses to physical addresses below 1 MB?
    When I checked the code for grub-0.97, I found that there are function
as below
           #define  phys_to_virt(x) (x)
           #define  virt_to_phys(x) (x)

Are there any similar functions in grub-1.97.1?

Also, when I allocated memory using grub_malloc() and printed the address
returned from the function it was (0x7da6d810). This seems to be a 32-bit
address. I wanted to know whether I can allocate some memory in the region
below 1MB?

Regards,
Kiran Pawar.

[-- Attachment #2: Type: text/html, Size: 752 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Regarding virtual to physical memory mapping..
  2009-12-31 12:15 Regarding virtual to physical memory mapping kiran pawar
@ 2009-12-31 12:31 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2009-12-31 13:36   ` Javier Martín
  2010-01-01 12:53   ` Robert Millan
  0 siblings, 2 replies; 5+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2009-12-31 12:31 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 1263 bytes --]

kiran pawar wrote:
> Hi all,
>     I am working on grub-1.97.1. I wanted to know if there is any
> mechanism in grub2 that maps virtual addresses to physical addresses
> below 1 MB?
>     When I checked the code for grub-0.97, I found that there are
> function as below
>            #define  phys_to_virt(x) (x)
>            #define  virt_to_phys(x) (x)
>  
grub runs without paging enabled. So such function is identity on x86.
> Are there any similar functions in grub-1.97.1? 
>
> Also, when I allocated memory using grub_malloc() and printed the
> address returned from the function it was (0x7da6d810). This seems to
> be a 32-bit address. I wanted to know whether I can allocate some
> memory in the region below 1MB?
Only in experimental branch. But we're not currently sure if we will use
this. If you want to make a BIOS call then use memory at
GRUB_SCRATCH_ADDR. If you do something else please explain
>
> Regards,
> Kiran Pawar.
> ------------------------------------------------------------------------
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>   


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 293 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Regarding virtual to physical memory mapping..
  2009-12-31 12:31 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2009-12-31 13:36   ` Javier Martín
  2010-01-01 12:53   ` Robert Millan
  1 sibling, 0 replies; 5+ messages in thread
From: Javier Martín @ 2009-12-31 13:36 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 866 bytes --]

El jue, 31-12-2009 a las 13:31 +0100, Vladimir 'φ-coder/phcoder'
Serbinenko escribió:
> kiran pawar wrote:
> > Also, when I allocated memory using grub_malloc() and printed the
> > address returned from the function it was (0x7da6d810). This seems to
> > be a 32-bit address. I wanted to know whether I can allocate some
> > memory in the region below 1MB?
> Only in experimental branch. But we're not currently sure if we will use
> this. If you want to make a BIOS call then use memory at
> GRUB_SCRATCH_ADDR. If you do something else please explain
How come not? Here's how it's done in drivemap, for example
    handler_base = grub_mmap_malign_and_register (16, total_size,
                       &drivemap_mmap, GRUB_MACHINE_MEMORY_RESERVED,
                       GRUB_MMAP_MALLOC_LOW);

-- 
-- Lazy, Oblivious, Recurrent Disaster -- Habbit

[-- Attachment #2: Esta parte del mensaje está firmada digitalmente --]
[-- Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Regarding virtual to physical memory mapping..
  2009-12-31 12:31 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2009-12-31 13:36   ` Javier Martín
@ 2010-01-01 12:53   ` Robert Millan
  1 sibling, 0 replies; 5+ messages in thread
From: Robert Millan @ 2010-01-01 12:53 UTC (permalink / raw)
  To: The development of GNU GRUB

On Thu, Dec 31, 2009 at 01:31:05PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> > I wanted to know whether I can allocate some
> > memory in the region below 1MB?
> Only in experimental branch. But we're not currently sure if we will use
> this.

We can use this.  My concerns are with making intrusive changes in the
standard heap.  I think it's important that kern/mm.c is small and simple,
but this doesn't preclude doing more fancy stuff in non-core areas.

Sorry if I was unclear about it.

-- 
Robert Millan

  "Be the change you want to see in the world" -- Gandhi



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Regarding virtual to physical memory mapping..
@ 2010-01-10  6:07 kiran pawar
  0 siblings, 0 replies; 5+ messages in thread
From: kiran pawar @ 2010-01-10  6:07 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 678 bytes --]

Hi all,
  Sorry for replying late.. and thanks everyone for replying. i am not clear
with answers that are given to the question .
  I have written a function in assembly that i have called form C code and
done the linking correctly. But i want
  this code should run in real mode. The address that i am getting for the
function is 0x5e45c000 which is a virtual address
  so i need to get its actual physical address to execute it in real mode
(which should be less than 1 MB).
 So i wanted to ask is there any way to do mapping from virtual to physical
in grub?
 Also is there any way by which i can have that assembly function placed
below 1 MB ?


Best regards,
Kiran Pawar.

[-- Attachment #2: Type: text/html, Size: 797 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-01-10  6:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-31 12:15 Regarding virtual to physical memory mapping kiran pawar
2009-12-31 12:31 ` Vladimir 'φ-coder/phcoder' Serbinenko
2009-12-31 13:36   ` Javier Martín
2010-01-01 12:53   ` Robert Millan
  -- strict thread matches above, loose matches on Subject: below --
2010-01-10  6:07 kiran pawar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.