From owner-freebsd-hackers Mon Jun 23 10:42:47 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id KAA17232 for hackers-outgoing; Mon, 23 Jun 1997 10:42:47 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.50]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id KAA17227 for ; Mon, 23 Jun 1997 10:42:45 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id KAA00897; Mon, 23 Jun 1997 10:31:43 -0700 From: Terry Lambert Message-Id: <199706231731.KAA00897@phaeton.artisoft.com> Subject: Re: direct access To: un_x@anchorage.net (Steve Howe) Date: Mon, 23 Jun 1997 10:31:43 -0700 (MST) Cc: hackers@FreeBSD.ORG In-Reply-To: from "Steve Howe" at Jun 22, 97 09:12:17 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > > it can read/write 1 RAM blocks > > > 2 Port Addresses > > > 3 Hard/Floppy Drives > > > 4 Files > > > A user process on any Unix system cannot easily edit 1, 2 or 3. > > that's what i'm finding out. but i want all the direct access and speed > i can get. how low-level can i get? i'd like the "driver" level. > is there specific documentation (other than source) about it? > what's /dev/io all about? If you open /dev/io, you are then permitted to read and write port addresses via {in|out}{b|w} instructions (use the macros in the system header files for best results). > simple low-level i/o routines moved to UN*X, namely > VGA-i/o, RAM-i/o, PORT-i/o, and DISK-i/o. > > for example, i need char i/o to the vga screen. You will need to open the /dev/vga device and mmap() it as a file. As long as you are talking about directly writing video RAM, and not INT 10 I/O, there's not a problem. The INT 10 I/O is problematic, since many card manufacturers too cheap to spring for dual ported (video) RAM want to avoid strobing except during the retrace interval (to eliminate "sparklies"). They do this by waiting for the vertical retrace before proceeding with the INT 10 operation. Because the INT 10 operation is time sensitive, they disable other interrupts while they are doing this. Like, oh, say the serial port which your PPP connection is on or the net card your LAN connection is on or the floppy controller that your non-FIFO protected QIC-40/80 tape is on, etc.. User generation of hardware interrupts is not permitted. > as far as ram goes, i like to watch whats going on > in physical ram to learn about systems. You would be much happier with opening /dev/kmem, /dev/mem, or /proc for the process you want to watch. A virtual memory system can be considered to be multiple machines running on the same hardware. The memory mappings are by kernel and per process page tables which references the virtual address space for the "machine". This, in turn, is backed by physical pages in 4k chunks. Looking at the physical pages is not going to give you a lot of information, but looking at the virtual pages can be quite informative for a given process. Many debuggers on UNIX work through /proc. > as far as drives go, file recovery - searching for deleted HD data, > which i desperatley need, Use "fsdb". Be warned that if you lose data on a drive while you are actively writing files, even temp files, on the same drive, that data is probably gone forever. In addition, the FS layout is significantly different than the FS layout for DOS. Because of this, most DOS tools will be completely useless. > as far as ports go, the code i'd like to port, detects and > debugs certain devices. This is a mistake if the machine has a PNP BIOS, or if the devices are EISA, PCI, or MCA (ie: anything other than ISA and those VESA devices which don't pretend they are EISA devices). You would be better off looking at the kernel probe data structures, which contain this information (this assumes that you use a "PNP-aware" kernel, or apply Sujal Patel's PNP patches to yyour kernel). Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.