9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: cinap_lenrek@felloff.net
To: 9fans@9fans.net
Subject: Re: [9fans] devsegment usage examples
Date: Wed, 31 Aug 2016 12:40:42 +0200	[thread overview]
Message-ID: <d36585458ad07b5015de17b3268c1542@felloff.net> (raw)
In-Reply-To: <CAHL7psEFdh5k2Lc1E01QEN4DYGzgef5W40YS3a1h_eBxNxioNg@mail.gmail.com>

> Hi, I'm looking for an usage example of devsegment.
> I cannot find anything neither in bhro's plan9 nor in 9front.
> Can anybody share a real usage world example?
> Giacomo

its just creating named segments of some shared memory.

segment(3) has an example. read it.

on 9front, you can also allocate physically continuous segments *and*
get the physical base address for it :)

one application for it is on the zynq. the displayport graphics is
implemented using the fpga and userspace uses devsegment
to allocate 5MB of physically continous memory for the framebuffer:

rfork en
bind -c '#g' /mnt/segment
if(! test -d /mnt/segment/fb){
	mkdir /mnt/segment/fb
	echo 'va 0x00500000 0x00500000 fixed' > /mnt/segment/fb/ctl

bind -b '#P' /dev
audio/pcmconv -i 'c1u32r1' -o 'c1U32r1' < ./build/out.bin > /dev/pl

then some c code programs the graphics register and hands the
loaded core the physical address for DMA.


  reply	other threads:[~2016-08-31 10:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-31  9:34 Giacomo Tesio
2016-08-31 10:40 ` cinap_lenrek [this message]
2016-08-31 12:57   ` Giacomo Tesio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d36585458ad07b5015de17b3268c1542@felloff.net \
    --to=cinap_lenrek@felloff.net \
    --cc=9fans@9fans.net \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).