From owner-freebsd-arch@FreeBSD.ORG Thu Sep 11 12:53:10 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 29BAF16A4BF for ; Thu, 11 Sep 2003 12:53:10 -0700 (PDT) Received: from postfix4-1.free.fr (postfix4-1.free.fr [213.228.0.62]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E1D443FD7 for ; Thu, 11 Sep 2003 12:53:09 -0700 (PDT) (envelope-from nsouch@perso.free.fr) Received: from armor.fastether (nas-cbv-8-62-147-156-37.dial.proxad.net [62.147.156.37]) by postfix4-1.free.fr (Postfix) with SMTP id 466AB4B2A9 for ; Thu, 11 Sep 2003 21:53:06 +0200 (CEST) Received: (qmail 5553 invoked by uid 1001); 11 Sep 2003 22:08:07 -0000 Date: Thu, 11 Sep 2003 22:08:07 +0000 From: Nicolas Souchu To: freebsd-arch@freebsd.org Message-ID: <20030911220807.A5528@armor.free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i cc: Marcel Moolenaar Subject: kgi4BSD progress report X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Sep 2003 19:53:10 -0000 Hi folks, Just to keep you informed about my console project. The project URL is now http://www.freebsd.org/~nsouch/kgi4BSD kgi4BSD comes to the point where the console messages are printed in 640x400x8 graphic mode using the gfb boot font. There is still no virtual terminal handling because I'm not sure about it in the kernel. Regarding this I'd be glad to have opinions about having the VTs managed outside the kernel. You'll find the current design picted at http://www.freebsd.org/~nsouch/kgi4BSD/design-notes.html for the text version. Concerning graphic mode, one should replace the ISO renderer and the TEXT16 resource by a called GFB renderer with a KGI fb resource. Blocks in the diagram interact through a flexible kobj API. Now comes the point where we all want better modes and portability. Better modes should be provided by KGI native driver which currently can only be probed during bus enumeration. Currently, the KGI drivers rely on a PCI API looking like this: #if KGI_SYS_NEED_i64 typedef __kgi_u64_t pcicfg_vaddr_t; /* the virtual address type */ #define PCICFG_64_NULL ((pcicfg_vaddr_t) 0xFFFFFFFFFFFFFFFF) #define PCICFG_NULL PCICFG_64_NULL #else typedef __kgi_u32_t pcicfg_vaddr_t; /* the virtual address type */ #define PCICFG_32_NULL ((pcicfg_vaddr_t) 0xFFFF0000) /* an invalid virtual address */ #define PCICFG_NULL PCICFG_32_NULL #endif #define PCICFG_VADDR(bus, slot, fn) \ !((bus+1 > 0) || (slot+1 > 0) || (fn+1 > 0)) \ ? PCICFG_NULL \ : ( (pcicfg_vaddr_t) \ ((((bus) & 0xFF) << 24) | (PCI_DEVFN((slot),(fn)) << 16)) ) #define PCICFG_BUS(vaddr) (((vaddr) >> 24) & 0xFF) #define PCICFG_DEV(vaddr) PCI_SLOT(((vaddr) >> 16) & 0xFF) #define PCICFG_FN(vaddr) PCI_FUNC(((vaddr) >> 16) & 0xFF) #define PCICFG_REG(vaddr) ((vaddr) & 0xFFFF) #define PCICFG_SIGNATURE(vendor, device) ((vendor << 16) | device) /* * FreeBSD specific stuff */ extern pcicfg_vaddr_t pcicfg_dev2cfg(device_t dev); extern struct pcicfg_dev *pcicfg_lookup_device(pcicfg_vaddr_t pcidev); extern device_t pcicfg_get_device(pcicfg_vaddr_t pcidev); extern int pcicfg_add_device(device_t dev); extern int pcicfg_remove_device(device_t dev); extern void pcicfg_claim_device(pcicfg_vaddr_t addr); extern void pcicfg_free_device(pcicfg_vaddr_t addr); extern int pcicfg_find_device(pcicfg_vaddr_t *addr, const __kgi_u32_t *signatures); extern int pcicfg_find_subsystem(pcicfg_vaddr_t *addr, const __kgi_u32_t *signatures); extern int pcicfg_find_class(pcicfg_vaddr_t *addr, const __kgi_u32_t *signatures); extern __kgi_u8_t pcicfg_in8 (const pcicfg_vaddr_t vaddr); extern __kgi_u16_t pcicfg_in16(const pcicfg_vaddr_t vaddr); extern __kgi_u32_t pcicfg_in32(const pcicfg_vaddr_t vaddr); extern void pcicfg_out8 (const __kgi_u8_t val, const pcicfg_vaddr_t vaddr); extern void pcicfg_out16(const __kgi_u16_t val, const pcicfg_vaddr_t vaddr); extern void pcicfg_out32(const __kgi_u32_t val, const pcicfg_vaddr_t vaddr); Currently, this API is only a wrapper to the FreeBSD pci newbus/buspace API. But, for the boot, this API could be simply implemented with arch specific code for accessing the PCI space. Then the bus enumeration could take the pcicfg structures to reserve the resources already acquired by the graphic driver during boot. Another approach could be to unload the driver after boot and reload it with the more appropriate pcicfg API then based on newbus/buspace. This second solution would enforce to use kobj for the pcicfg to enable ABI compatibility between the 2 pcicfg implementations (avoiding relinking). We have to provide a convenient way to fully use the KGI drivers even with arch specific code at boot. All ideas/remarks are welcome. Nicholas -- Nicholas Souchu - nsouch@free.fr - nsouch@FreeBSD.org