public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] svgalib error in mmap documentation
@ 2001-01-06  8:33 Matan Ziv-Av
  2001-01-06 15:42 ` Alan Cox
  0 siblings, 1 reply; 5+ messages in thread
From: Matan Ziv-Av @ 2001-01-06  8:33 UTC (permalink / raw)
  To: linux-kernel; +Cc: Linus Torvalds



Hi,

svgalib needs to be compiled without background support in order to run
under kernl 2.4.0 or newer. Here's a patch to Documentation/Changes that
says this.

--- /usr/src/linux.b/Documentation/Changes        Tue Dec 12 18:43:22 2000
+++ linux/Documentation/Changes     Sat Jan  6 10:28:20 2001
@@ -517,6 +517,14 @@
 Older isdn4k-utils versions don't support EXTRAVERSION into kernel version
 string. A upgrade to isdn4k-utils.v3.1beta7 or later is recomented.

+SVGAlib
+=======
+If you want svgalib programs to run with kernel 2.4.0 or newer, svgalib
+needs to be compiled without background support (BACKGROUND not defined in
+Makefile.cfg). This is relevant to any svgalib version.
+This is because svgalib uses mmap of /proc/mem to emulate vga's memory bank
+switching when in background, and kernel 2.4.0 stopped supporting this feature.
+


-- 
Matan Ziv-Av.                         matan@svgalib.org


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

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

* Re: [PATCH] svgalib error in mmap documentation
  2001-01-06  8:33 [PATCH] svgalib error in mmap documentation Matan Ziv-Av
@ 2001-01-06 15:42 ` Alan Cox
  2001-01-06 21:22   ` Matan Ziv-Av
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Cox @ 2001-01-06 15:42 UTC (permalink / raw)
  To: matan; +Cc: linux-kernel, Linus Torvalds

> +If you want svgalib programs to run with kernel 2.4.0 or newer, svgalib
> +needs to be compiled without background support (BACKGROUND not defined in
> +Makefile.cfg). This is relevant to any svgalib version.
> +This is because svgalib uses mmap of /proc/mem to emulate vga's memory bank
> +switching when in background, and kernel 2.4.0 stopped supporting this feature.

2.4 has real support for shared mappings, so you can I suspect do it properly
now

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

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

* Re: [PATCH] svgalib error in mmap documentation
  2001-01-06 15:42 ` Alan Cox
@ 2001-01-06 21:22   ` Matan Ziv-Av
  2001-01-06 21:50     ` Alan Cox
  2001-01-07  9:16     ` Christoph Rohland
  0 siblings, 2 replies; 5+ messages in thread
From: Matan Ziv-Av @ 2001-01-06 21:22 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

On Sat, 6 Jan 2001, Alan Cox wrote:

> > +If you want svgalib programs to run with kernel 2.4.0 or newer, svgalib
> > +needs to be compiled without background support (BACKGROUND not defined in
> > +Makefile.cfg). This is relevant to any svgalib version.
> > +This is because svgalib uses mmap of/proc/mem to emulate vga's memory bank
> > +switching when in background, and kernel 2.4.0 stopped supporting this feature.
> 
> 2.4 has real support for shared mappings, so you can I suspect do it properly
> now

I hope it is reasonable to ask, how?

What I need is to allocate a big amount of memory (say 1MB, for
example), copy the video memory to it, and then have fixed 64K of
virutal address of the process point to any 64K window of the large
allocated memory. How can I do it?


-- 
Matan Ziv-Av.                         matan@svgalib.org

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

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

* Re: [PATCH] svgalib error in mmap documentation
  2001-01-06 21:22   ` Matan Ziv-Av
@ 2001-01-06 21:50     ` Alan Cox
  2001-01-07  9:16     ` Christoph Rohland
  1 sibling, 0 replies; 5+ messages in thread
From: Alan Cox @ 2001-01-06 21:50 UTC (permalink / raw)
  To: matan; +Cc: Alan Cox, linux-kernel

> I hope it is reasonable to ask, how?

POSIX shared memory calls or sys5 shm

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

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

* Re: [PATCH] svgalib error in mmap documentation
  2001-01-06 21:22   ` Matan Ziv-Av
  2001-01-06 21:50     ` Alan Cox
@ 2001-01-07  9:16     ` Christoph Rohland
  1 sibling, 0 replies; 5+ messages in thread
From: Christoph Rohland @ 2001-01-07  9:16 UTC (permalink / raw)
  To: Matan Ziv-Av; +Cc: Alan Cox, linux-kernel

Matan Ziv-Av <matan@svgalib.org> writes:

> I hope it is reasonable to ask, how?
> 
> What I need is to allocate a big amount of memory (say 1MB, for
> example), copy the video memory to it, and then have fixed 64K of
> virutal address of the process point to any 64K window of the large
> allocated memory. How can I do it?

fd = shm_open("vidmem-filename", O_CREAT,...);
ftruncate(fd, 1<<20);
ptr = mmap(0, 64 * 1<<10, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);

to remap another area:

if (mmap(ptr, 64 * 1<<10, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_FIXED, 
         fd, blocknr * 64 * 1<<10) != ptr)
        error();

On exit:

munmap(ptr, 64 * 1<<10);
shm_unlink ("vidmem-filename");

Note the MAP_FIXED argument to the remap operation. You do not need to
unmap on Linux to remap an area when giving MAP_FIXED. (So MAP_FIXED
can to really bad things to your program...)

Greetings
                Christoph

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

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

end of thread, other threads:[~2001-01-07  9:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-06  8:33 [PATCH] svgalib error in mmap documentation Matan Ziv-Av
2001-01-06 15:42 ` Alan Cox
2001-01-06 21:22   ` Matan Ziv-Av
2001-01-06 21:50     ` Alan Cox
2001-01-07  9:16     ` Christoph Rohland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox