*BSD News Article 15943


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!constellation!osuunx.ucc.okstate.edu!moe.ksu.ksu.edu!zaphod.mps.ohio-state.edu!cs.utexas.edu!uunet!news.univie.ac.at!fstgds15.tu-graz.ac.at!fstgds01.tu-graz.ac.at!not-for-mail
From: chmr@edvz.tu-graz.ac.at (Christoph Robitschko)
Newsgroups: comp.os.386bsd.development
Subject: Re: kernel hacking tips
Date: 12 May 1993 09:11:48 +0200
Organization: Technical University of Graz, Austria
Lines: 30
Message-ID: <1sq7vkINNnai@fstgds01.tu-graz.ac.at>
References: <1993May11.192459.1618@ucsu.Colorado.EDU>
NNTP-Posting-Host: fstgds01.tu-graz.ac.at
X-Newsreader: TIN [version 1.1 PL7]

In article <1993May11.192459.1618@ucsu.Colorado.EDU> GALBRAITH JOHN (galbrait@rintintin.Colorado.EDU) wrote:
> This is great news.  Thanks for the advice.  However, you still have to
> reboot (and wait for the fsck and the mounts, and ...) every time you actually
> try out new changes right?

You can get around the fsck by using fastboot, or you can tell the bootblocks
to boot the kernel singleuser, and then type ^D to boot up without fsck.
I like to test kernel mods in singleuser mode, because the root file system
is still mounted read-only, so it is not so easy to destroy everything.
> 
> Has anybody tried to cheat and write a driver that does nothing but give
> you access to an outb() and inb() instruction?  This might speed development
> for a big project.  The new driver gets written and debugged before it is ever
> added to the kernel so you don't have to constantly reboot.  Or what about
> doing an inline assembly call to outb with no kernel support at all?

You can simply look in the pccons.c file how the X-server gains permission
to do I/O instructions (in function pc_xmode_on). You just have to place 
an ioctl to just give you I/O permission in any driver (I've used the
console driver), call the ioctl from your user-level program and you can
use inb and outb in this program (You can take the inb and outb routines
from locore.s).
If you try to use inb/outb from user level without previously gaining
permission will abort your program.
> 
> john 
> galbrait@rintintin.colorado.edu
> 
> 
								Christoph