Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Jun 1997 04:56:43 -0700
From:      John-Mark Gurney <jmg@hydrogen.nike.efn.org>
To:        Steve Howe <un_x@anchorage.net>
Cc:        Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>, freebsd-hackers <hackers@FreeBSD.ORG>
Subject:   Re: direct access
Message-ID:  <19970623045643.10686@hydrogen.nike.efn.org>
In-Reply-To: <Pine.BSF.3.95q.970623002024.21409A-100000@aak.anchorage.net>; from Steve Howe on Mon, Jun 23, 1997 at 02:36:37AM -0800
References:  <19970623100142.PK61527@uriah.heep.sax.de> <Pine.BSF.3.95q.970623002024.21409A-100000@aak.anchorage.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Steve Howe scribbled this message on Jun 23:

[man io deleted]

> > > what's /dev/io all about?
> 
> > RTFM...  Did you ever try ``man io'', to the least?  Apparently not.
> 
> yes - but i didn't learn too much.  can't say
> i learned enough to do anything with it.
> thanks though.

so? what don't you understand?? have you looked at code that does
direct io maniuplation??  (such as the kernel)...  UTSL!!  you have
access to the complete source tree...

UTSL == Use The Source Luke

> i searched through the maillist archives,
> handbook, and faq, and didn't see 
> much on c-programming i/o basics.
> i'm sure it doesn't take an einstein,
> but of course, i'm basing that on my 
> limited knowledge.  i've only been
> programming since 1981, not 1945,
> and i only know about 10 languages, 
> not 100, and i've only been hacking
> FBSD for 2 years ...  not 20.

well, it's all documented in the source... I'm trying to think how I
learned direct VGA writing under FreeBSD... I think it was libdgl
that Søren wrote...  but that wasn't much help...

> > > for example, i need char i/o to the vga screen.
> 
> > No, you don't need it.  You _think_ you need it.  This makes your
> > application totally unportable, and people will really hate you for
> > this crap then.  (You will even hate yourself two years later, believe
> 
> how do you know i don't need it?  i have special needs with embedded
> hardware FreeBSD doesn't support, and that i don't expect FreeBSD to
> support, and i'm sure i'm not alone.  and i don't have time to re-write
> everything from the ground up right now.  how do you know my timelines, 
> my priorities, or if i will even give it out for other people to use,
> or if i will ever use it on non-pc based computers?

so, if you need direct char access, hmm... I need access to the physical
address 0xa0000, and need to have it in my address space...  hmmm...
/dev/mem is the char device for all of memory (obtained from the SEE ALSO
line on io(4))... hmmm... mmap (obtained via an apropos of memory or map)
maps part of a file or char device into my address space...  that just
might work!! (and it does)

almost all of this is documented... about the only thing that lacks
complete documentation is the kernel, but there have been MAJOR
improvements in this area with the introduction of section 9...

> > portable back to a CP/M machine connected via Kermit emulating an ADM3a
> > or VT52 terminal.  If your terminal supports colors, you can also get
> 
> this is the 90's - i don't care about adm3a/vt52's.
> i care about BSD's/Linux/POSIX and hardware i/o testing.
> and i don't want to be 90 before i port some 'drivers'
> to use for myself.  and i don't want my trees of
> development to split too far between my embedded
> systems code and UN*X code.  it will become too much
> to maintain for now.  for example, i read the slang lib 
> may be faster than ncurses...   but i can't 
> find any docs on slang i/o.  maybe there's 
> even faster alternatives?

so, your going to limit yourself to the syscons??  if you do I hope you
realize that I won't be able to use it was I'm using an xterm right now
run under screen (which happens to be doing a cvs tree update in another
window)...  kinda hard to write directly to the screen considering that
I might detatch screen and relocate it to my notebook (which could be
in SF, which I did a week ago)...

> > colors.  You read the character back from a backup buffer curses
> > maintains inside the program's address space. 
> 
> i can't find any info on this backup buffer in ncurses.
> i tried "apropos buf", "apropos back", ...  i tried the
> manpages on ncurses stuff, couldn't find anything.
> i can find what a current pair color is.
> and curses.h doesn't compile well with c++.
> besides, from what i read, curses is out of date.

curses is out of date, but if I remeber correctly, ncurses is still
being maintained...

> > > > > unsigned char * p = (unsigned char *)0x000b8000;
> > > > You cannot directly access the physical address 0x000b8000.
> > > is that an absolute?  no peek-ing or poke-ing ... at all?
> 
> > inside the kernel address space), thus you always need a mapping.  The
> > kernel provides for mappings in the ``ISA IO memory hole'', but for
> > anything else, you're responsible yourself.
> 
> so - i just match the virtual addresses to physical, by reading
> this map, then i turn off some flag, and i can read ram ... 

see above...  need to look at /dev/MAKEDEV and see what's avaliable
to you...

[...]

> > > as far as ports go, the code i'd like to port, detects and
> > > debugs certain devices.
> 
> > Leave this to kernel code.  Write LKMs with device drivers.
> 
> i would like to use FreeBSD for embedded systems, and the kernel
> doesn't support devices i need to use.  maybe lkm's -are- what i need?

> > soon make it obvious to you that all your questions were no-brainers
> > from the beginning.  Sorry for sounding harsh.
> 
> sorry for being a so stupid.
> i do appreciate your knowledge.

it's just that you haven't done the research neccessary...  I started
using FreeBSD three years ago... I had barely used unix before the time
I installed it...  I had done a varaity of dos programming... at first I
just listened on questions as hackers was a complete mystery to me at
the time... after a few months I subscribed to hackers and have learned
most of what I know by the conversation that goes on -hackers...

then after a couple years, dos is just a toy os anymore...  about the
only reason I have a dos machine around is to play games...

if your really on a time schedule, there are people who would be willing
to do the work, assuming you have the money to pay them...

hope this info helps... you can learn much more by reading -hackers...

-- 
  John-Mark Gurney                          Modem/FAX: +1 541 683 6954
  Cu Networking

  Live in Peace, destroy Micro$oft, support free software, run FreeBSD



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19970623045643.10686>