From owner-freebsd-drivers@FreeBSD.ORG Thu Jun 21 07:44:55 2007 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C5BE916A41F for ; Thu, 21 Jun 2007 07:44:55 +0000 (UTC) (envelope-from alexander.pohoyda@gmx.net) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 2080213C455 for ; Thu, 21 Jun 2007 07:44:54 +0000 (UTC) (envelope-from alexander.pohoyda@gmx.net) Received: (qmail 30217 invoked by uid 0); 21 Jun 2007 07:18:14 -0000 Received: from 155.56.68.220 by www053.gmx.net with HTTP; Thu, 21 Jun 2007 09:18:14 +0200 (CEST) Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii" Date: Thu, 21 Jun 2007 09:18:14 +0200 From: "Alexander Pohoyda" Message-ID: <20070621071814.271290@gmx.net> MIME-Version: 1.0 To: freebsd-drivers@freebsd.org X-Authenticated: #14602519 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 X-Provags-ID: V01U2FsdGVkX1/Oe6RWDdTO11uErs7HkBrPh76U1AnmBE2TSPV6Qh hEgP6DgV7Bdmk8ZkW+YpcFMTiVYgThgVJ1yA== X-GMX-UID: BRFId81BIydmBDK0qmdrCb9Sa2FkZhX1 Subject: Finally SiS190 NIC driver ported! X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2007 07:44:55 -0000 Hello, Based on the code of SiS900/7016 FreeBSD driver and using SiS190/191 Linux and Solaris drivers as references, I have developed a working FreeBSD driver for the above mentioned SiS190 NIC. It works stable for a few months on my amd64-based FreeBSD-5.4 machine in 64bit mode. I don't know whether it works in 32bit mode. I have also removed the sis_poll() code because I didn't have time to test it. Since this is my first driver ever, I have a few questions open which I would like to clarify. This NIC uses main memory for both receive and transmit descriptor rings but descriptor structures and registers are different from the ones used in SiS900/7016, so I decided to write a separate driver. How should I name this new driver? Is if_sis190.c + if_sis190reg.h right? It could later be extended to support also SiS191 NIC, I suppose. Or should I really merge the code with the sis(4) driver? I do not clearly understand the reason of separating the data into list_data and chain_data structures. It seems unnecessary in my driver. In sis_encap() function I have to always defragment MBUF chain, otherwise big packets (e.g. during SSH connection there are packets consisting of 3 chunks) are broken. When defragmentation is done -- SSH and other protocols work. Is there a well-known mistake that causes this behavior? -- Alexander Pohoyda PGP Key fingerprint: 7F C9 CC 5A 75 CD 89 72 15 54 5F 62 20 23 C6 44 From owner-freebsd-drivers@FreeBSD.ORG Thu Jun 21 09:08:54 2007 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9CD5B16A468 for ; Thu, 21 Jun 2007 09:08:54 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.230]) by mx1.freebsd.org (Postfix) with ESMTP id 423BC13C45D for ; Thu, 21 Jun 2007 09:08:54 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by nz-out-0506.google.com with SMTP id 14so429404nzn for ; Thu, 21 Jun 2007 02:08:53 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:received:received:date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=Fys6QjZl9BXQ1YaHOc/I2hQ9RVLjG1GnOVukMFx22GbREZ4hWt3asmPXcw9SQKA2cQLOORd0yYaq7Pp//+bN9V39VWZKXGkjWLd2Cad2dX0PTa1o8sHZt8F9rbH4VCaJUxpe8WswHczakrjnB91ODb8Rui9Clv5tC/n0pBCWL24= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=SVNjt+mid5/4dJD5A1HDLwzfOh5tOe/wzIxNMj/9jrdMLCvcd+uzpIyPe8a9z1yh68GMH8ZWtdr3FzpjLSWgcAlrXMdMMp93c8syt2tU87Ou8Od4bJ66iRn7kBMyPhItP9fGYtYeSwZflDwFpkOfF0waTLpKWFyOyRTt14LP0gI= Received: by 10.115.77.1 with SMTP id e1mr1334588wal.1182415197275; Thu, 21 Jun 2007 01:39:57 -0700 (PDT) Received: from michelle.cdnetworks.co.kr ( [211.53.35.84]) by mx.google.com with ESMTP id m10sm1210491waf.2007.06.21.01.39.55 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Jun 2007 01:39:56 -0700 (PDT) Received: from michelle.cdnetworks.co.kr (localhost.cdnetworks.co.kr [127.0.0.1]) by michelle.cdnetworks.co.kr (8.13.5/8.13.5) with ESMTP id l5L8doSr023242 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 21 Jun 2007 17:39:50 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id l5L8dnND023241; Thu, 21 Jun 2007 17:39:49 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Thu, 21 Jun 2007 17:39:49 +0900 From: Pyun YongHyeon To: Alexander Pohoyda Message-ID: <20070621083949.GF21711@cdnetworks.co.kr> References: <20070621071814.271290@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070621071814.271290@gmx.net> User-Agent: Mutt/1.4.2.1i Cc: freebsd-drivers@freebsd.org Subject: Re: Finally SiS190 NIC driver ported! X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2007 09:08:54 -0000 On Thu, Jun 21, 2007 at 09:18:14AM +0200, Alexander Pohoyda wrote: > Hello, > > Based on the code of SiS900/7016 FreeBSD driver and using SiS190/191 Linux and Solaris drivers as references, I have developed a working FreeBSD driver for the above mentioned SiS190 NIC. > > It works stable for a few months on my amd64-based FreeBSD-5.4 machine in 64bit mode. I don't know whether it works in 32bit mode. I have also removed the sis_poll() code because I didn't have time to test it. > > Since this is my first driver ever, I have a few questions open which I would like to clarify. > > This NIC uses main memory for both receive and transmit descriptor rings but descriptor structures and registers are different from the ones used in SiS900/7016, so I decided to write a separate driver. How should I name this new driver? Is if_sis190.c + if_sis190reg.h right? It could later be extended to support also SiS191 NIC, I suppose. Or should I really merge the code with the sis(4) driver? I don't have any information for SiS190/191 so I don't know the differences between SiS190 and SiS900. However it's Gigabit ethernet so I guess it would require a seperate driver for the hardware. Personally, I think merging with sis(4) is not good idea. sis(4) needs big clean up for bus_dma/endian-ness. > > I do not clearly understand the reason of separating the data into list_data and chain_data structures. It seems unnecessary in my driver. It may help managing DMA tag/map and descriptor rings. > > In sis_encap() function I have to always defragment MBUF chain, otherwise big packets (e.g. during SSH connection there are packets consisting of 3 chunks) are broken. When defragmentation is done -- SSH and other protocols work. Is there a well-known mistake that causes this behavior? > Since I didn't see datasheet for the hardware I can not say what caused this. But the hardware may have required special DMA address alignment. Otherwise you may had missed descriptor set up sequences such that you may have seen the result of races with hardware. -- Regards, Pyun YongHyeon From owner-freebsd-drivers@FreeBSD.ORG Thu Jun 21 09:42:38 2007 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8B07116A41F for ; Thu, 21 Jun 2007 09:42:38 +0000 (UTC) (envelope-from mjalvarez@fastmail.fm) Received: from out3.smtp.messagingengine.com (out3.smtp.messagingengine.com [66.111.4.27]) by mx1.freebsd.org (Postfix) with ESMTP id 5327A13C484 for ; Thu, 21 Jun 2007 09:42:38 +0000 (UTC) (envelope-from mjalvarez@fastmail.fm) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 8EB741858 for ; Thu, 21 Jun 2007 05:28:21 -0400 (EDT) Received: from web6.messagingengine.com ([10.202.2.215]) by compute1.internal (MEProxy); Thu, 21 Jun 2007 05:28:21 -0400 Received: by web6.messagingengine.com (Postfix, from userid 99) id 9AD6B1F6AF; Thu, 21 Jun 2007 05:28:21 -0400 (EDT) Message-Id: <1182418101.6802.1196302545@webmail.messagingengine.com> X-Sasl-Enc: owKbb4CUy17bqIhpWw41c8idgqOC16CED6GQvvrLcSkj 1182418101 From: "Mark Jayson Alvarez" To: freebsd-drivers@freebsd.org Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="ISO-8859-1" MIME-Version: 1.0 X-Mailer: MessagingEngine.com Webmail Interface Date: Thu, 21 Jun 2007 17:28:21 +0800 Subject: Where software meets hardware.. X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2007 09:42:38 -0000 Hi, Good day! I could have sent this to questions@freebsd.org but I know it will get treated as irrelevant topic as well. Just trying my luck here though. Those of you who've been inspired with my curiosity may email me directly. :-) Just f***ing google it advices are also welcome. I have a cousin who's taking up a programming course. He doesn't have background with programming nor an in depth understanding of how the computer works. I tried explaining him that it all started with abacus, and that people wanted to use something that could make their arithmetic life easier and that Charles Babbage tried automating this manual calculator with his steam engine or some sort... and that... oh, forget about these craps.=20 This is how my programming teacher explains how a program gets executed. First you compile it into a machine readable code, then the operating system writes it in the memory, and finally the CPU fetches it and it finally gets toasted by the electricity flowing on the CPU's surface. It doesn't make things clearer though.:-( Here's how I understand it: Suppose I'm writing this email. If I press a letter in the keyboard,=20 it generates an tiny electric current which eventually translated to interrupt. Next the keyboard driver picks this up and tell the operating to talk to the monitor driver and output the letter in my=20 monitor.. I really don't get it. Can you in a very simple sentence explain to me how and where a software program meets the hardware? Does it have anything to do with the bios? Wiki entry for it doesn't say much about this. It only says, this is how things get started when you power on your pc. The bios initializes all your computer parts, then call the boot loader and so on and so forth.. I really wanted to get down really really low. Someone told me to read a driver source code in C but if I compile it, it will still be translated into assembly code or something. Still the operating system reads that code and the cycle goes on again. I am no programmer by profession but I do know how to program. I told my cousin, that someday he will be a real programmer and that even if he will be dealing only with java, html, animation and all sorts of high level programming stuffs, in the spirit of open source (and freebsd of course), it's better that he knows exactly how a program interacts with the physical computer. Thanks for the time. I hope this one doesn't bounce back. :-) --=20 Mark Jayson Alvarez mjalvarez@fastmail.fm --=20 http://www.fastmail.fm - Same, same, but different=85 From owner-freebsd-drivers@FreeBSD.ORG Thu Jun 21 12:56:36 2007 Return-Path: X-Original-To: freebsd-drivers@FreeBSD.ORG Delivered-To: freebsd-drivers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CE66D16A400; Thu, 21 Jun 2007 12:56:36 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.freebsd.org (Postfix) with ESMTP id 3042D13C44B; Thu, 21 Jun 2007 12:56:35 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (wnspsl@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id l5LCXuNi082846; Thu, 21 Jun 2007 14:34:02 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id l5LCXuYv082845; Thu, 21 Jun 2007 14:33:56 +0200 (CEST) (envelope-from olli) Date: Thu, 21 Jun 2007 14:33:56 +0200 (CEST) Message-Id: <200706211233.l5LCXuYv082845@lurza.secnetix.de> From: Oliver Fromme To: freebsd-drivers@FreeBSD.ORG, mjalvarez@fastmail.fm, freebsd-chat@FreeBSD.ORG In-Reply-To: <1182418101.6802.1196302545@webmail.messagingengine.com> X-Newsgroups: list.freebsd-drivers User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (FreeBSD/4.11-STABLE (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Thu, 21 Jun 2007 14:34:02 +0200 (CEST) Cc: Subject: Re: Where software meets hardware.. X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-chat@FreeBSD.ORG, mjalvarez@fastmail.fm List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2007 12:56:36 -0000 Mark Jayson Alvarez wrote: > Good day! I could have sent this to questions@freebsd.org but I know > it will get treated as irrelevant topic as well. Just trying my luck > here though. Actually this is most appropriate on the "chat" list. I've redirected replies there. > I have a cousin who's taking up a programming course. He doesn't have > background with programming nor an in depth understanding of how the > computer works. I tried explaining him that it all started with > abacus, and that people wanted to use something that could make their > arithmetic life easier and that Charles Babbage tried automating this > manual calculator with his steam engine or some sort... and that... Actually Charles Babbage designed a complex mechanical computing machine (with lots of gearwheels etc.), but it only ever existed on paper. Only small parts of it have actually been built, but never the whole thing, because it was too complex. It would work in theory, though. :-) > This is how my programming teacher explains how a program gets > executed. First you compile it into a machine readable code, then > the operating system writes it in the memory, and finally the CPU > fetches it and it finally gets toasted by the electricity flowing on > the CPU's surface. It doesn't make things clearer though.:-( That's pretty close to the truth, actually. > I really don't get it. Can you in a very simple sentence explain to > me how and where a software program I'm afraid the interactions between memory, processor (CPU) and software is a complex thing which cannot be explained in a single simple sentence. I'll try to explain a bit ... A processor is able to execute instructions which are called "machine code". Basically it's a sequence of bytes stored in memory (RAM). The processor fetches byte after byte from memory and executes the commands that they represent. Such commands include: "load a number from memory into a processor register", or "add these two processor registers and store the result in memory", or "check whether this value is zero, and if it is, then jump to a specified address in memory instead of continuing with the following instruction". It's possible to have loops, subroutines, interrupt routines and other things, but the details aren't important in order to get a basic understanding. Of course, most programmers don't write that machine code directly. It's efficient for the processor to execute, but it's inconvenient for a human programmer to write. A programmer usually writes programs in a higher-level language, such as C. Then a tool called compiler is used to convert that "source code" into "machine code" that can be executed by the processor. The result is an executable file stored on disk (also called a "binary"). When a binary is about to be executed, the operating system (such as FreeBSD) loads it from disk into RAM where its byte stream can be executed by the processor. Of course in reality it's more complicated, but the above are the very basic and low-level things that happen. Device drivers are somewhat different. They're normal binaries, too (usually compiled from source code, too), but they're loaded once when the operating system boots the computer, or once when the appropriate kernel module is loaded. Many device drivers are interrupt- driven. When an external event occurs, such as a packet arriving on a network interface, or the user pressing a key on the keyboard, the hardware device signals an interrupt to the processor (basically a connector pin on the processor is set from "low" to "high", i.e. from 0 V to 5 V or similar). The processor stops whatever it is doing right now, fetches the address of an "interrupt handler routine" from memory, and jumps to that address (i.e. starts executing instructions from that address). That handler is usually installed in memory by the operating system. The code checks which device caused the interrupt, and then executes the appropriate routine in the corresponding device driver. When it's finished, a "return" instruction is executed, which causes the processor to resume whatever it was doing before the interrupt occured. > Does it have anything to do with the bios? The BIOS is also simply a piece of software, stored in a chip on the mainboard. It initializes the hard- ware right after the machine is switched on, and arranges for the operating system to be booted from the disk (or from other kind of media if supported). After the operating system takes control of the box, the BIOS is not used anymore at all. (There are certain exceptions, but lets forget about them for now.) Booting is usually a multi-stage process, i.e. first the BIOS loads a tiny boot loader from the first sector of the disk (the MBR == master boot record), then the code contained in the MBR loads the operating system's first stage boot loader and so on. All of those stages still use BIOS routines to access the disk. The last stage (in FreeBSD that's /boot/loader) loads the actual OS, i.e. the kernel and modules that are required to boot the OS. The kernel has its own device drivers for disks and other media, so it doesn't use the BIOS anymore. > I told my cousin, that someday he will be a real programmer and that > even if he will be dealing only with java, html, animation and all > sorts of high level programming stuffs, It should be pointed out that HTML is not a programming language. ;-) > in the spirit of open source (and freebsd of course), it's better > that he knows exactly how a program interacts with the physical > computer. Well ... It depends. As a high-level programmer, it is good to know how machine code works and how the compiler generates it, because it also enables you to write more efficient programs. That's especially true for kernel source and device drivers. On the other hand, both processors and compilers become more and more complex and advanced, and newly designed higher-level languages (such as Python) increase the "distance" between machine code and the source code that people write, so there is less relationship. Therefore I think that nowadays it is more important to learn software design, how to develop efficient algorithms, learn a bit about computational complexity (for example, when and why is quicksort faster than bubblesort) etc. At university there was a teacher who said that you should learn as many different programming languages as possible, at least one of every kind, i.e. one of the "classical brace languages", such as C, at least one object-oriented language (e.g. Smalltalk, Eiffel), one functional language (Haskell or OCaml), one assembly language (no matter which one) and so on. The more the better. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead." -- RFC 1925 From owner-freebsd-drivers@FreeBSD.ORG Thu Jun 21 21:55:46 2007 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8538616A468 for ; Thu, 21 Jun 2007 21:55:46 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 69D6713C45E for ; Thu, 21 Jun 2007 21:55:46 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 959A11A4D8F; Thu, 21 Jun 2007 14:29:55 -0700 (PDT) Date: Thu, 21 Jun 2007 14:29:55 -0700 From: Alfred Perlstein To: Mark Jayson Alvarez Message-ID: <20070621212955.GT98795@elvis.mu.org> References: <1182418101.6802.1196302545@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1182418101.6802.1196302545@webmail.messagingengine.com> User-Agent: Mutt/1.4.2.2i Cc: freebsd-drivers@freebsd.org Subject: Re: Where software meets hardware.. X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2007 21:55:46 -0000 Mark, you've pretty much answered your own question in your email here. Your compiled software is somehow loaded into memory as a steam of instructions that will be executed by the cpu. This executed stream of instructions, besides doing interesting things like math and flow control can access hardware through special "input/output instructions" or through "input/output virtualization through memory access". This is how software interacts with hardware. Think of one of those automatic pianos that work off one of those reams of paper that has holes punched into it. The original sheet music is "the source program". The punched hole tape is the "program loaded and compiled into memory". The thing that loads the tape is the "operator" or maybe even "operating system". And the mechanism inside the piano that reads the tape is CPU. Each hole is an "io instruction" that the CPU interprets and sends a signal to cause a hammer to hit a string. The hammer and strings are the "hardware". * Mark Jayson Alvarez [070621 02:41] wrote: > Hi, > > Good day! I could have sent this to questions@freebsd.org but I know it > will get treated > as irrelevant topic as well. Just trying my luck here though. Those of > you who've been > inspired with my curiosity may email me directly. :-) Just f***ing > google it advices are also > welcome. > > I have a cousin who's taking up a programming course. He doesn't have > background with > programming nor an in depth understanding of how the computer works. > I tried explaining him that it all started with abacus, and that people > wanted to use > something that could make their arithmetic life easier and that Charles > Babbage tried > automating this manual calculator with his steam engine or some sort... > and that... oh, > forget about these craps. > > This is how my programming teacher explains how a program gets executed. > First you compile > it into a machine readable code, then the operating system writes it in > the memory, and finally > the CPU fetches it and it finally gets toasted by the electricity > flowing on the CPU's surface. > It doesn't make things clearer though.:-( > > Here's how I understand it: Suppose I'm writing this email. If I press a > letter in the keyboard, > it generates an tiny electric current which eventually translated to > interrupt. Next the keyboard driver > picks this up and tell the operating to talk to the monitor driver and > output the letter in my > monitor.. > > I really don't get it. Can you in a very simple sentence explain to me > how and where a software program > meets the hardware? Does it have anything to do with the bios? Wiki > entry for it doesn't say much about > this. It only says, this is how things get started when you power on > your pc. The bios initializes all > your computer parts, then call the boot loader and so on and so forth.. > > I really wanted to get down really really low. Someone told me to read a > driver source code in C but if I compile it, it will still be translated > into assembly code or something. Still the operating system reads that > code and the cycle goes on again. I am no programmer by profession but I > do know how to program. I told my cousin, that someday he will be a real > programmer and that even if he will be dealing only with java, html, > animation and all sorts of high level programming stuffs, in the spirit > of open source (and freebsd of course), it's better that he knows > exactly how a program interacts with the physical computer. > > > Thanks for the time. > I hope this one doesn't bounce back. :-) > > > > -- > Mark Jayson Alvarez > mjalvarez@fastmail.fm > > -- > http://www.fastmail.fm - Same, same, but different? > > _______________________________________________ > freebsd-drivers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-drivers > To unsubscribe, send any mail to "freebsd-drivers-unsubscribe@freebsd.org" -- - Alfred Perlstein From owner-freebsd-drivers@FreeBSD.ORG Fri Jun 22 14:46:08 2007 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BE5D616A421 for ; Fri, 22 Jun 2007 14:46:08 +0000 (UTC) (envelope-from die.gestalt@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.176]) by mx1.freebsd.org (Postfix) with ESMTP id 7B45B13C48C for ; Fri, 22 Jun 2007 14:46:08 +0000 (UTC) (envelope-from die.gestalt@gmail.com) Received: by py-out-1112.google.com with SMTP id u77so363975pyb for ; Fri, 22 Jun 2007 07:46:07 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=LBYD8k0WonJXBEUlnSGrf3soAV9In5cBkVhl6st/8Xn5IOfZE0vhuK+0UTSv2e4fJIgoX18klO65f32sD+3g/4igrqjkyxRuZfzTPoyS+Fo/g0MzyR6OUrr1x5YiTpoAv3xjehKcp76kqbj0WhS8Mc/jnGf+unQ+hohOjmIIluw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=i54FpR/573DoFb5Q3Beyxe87s4EIF50hXUHP/QowU2cJR12obiPHk0Ma0Y2t+6vgIt0PtwFmRGEjDlR31xxU0zJK/nQdpUiI8nlBLBUktPpZwmyvDd6hmZLeGaRe161tEYByByeml6XsGESbiAVafwwHhv3QK1fb/2k5yK0sgeA= Received: by 10.65.150.18 with SMTP id c18mr5775462qbo.1182523566813; Fri, 22 Jun 2007 07:46:06 -0700 (PDT) Received: by 10.64.180.9 with HTTP; Fri, 22 Jun 2007 07:46:06 -0700 (PDT) Message-ID: <5bf3e10d0706220746y1a114792scd1ec59b95ed0ca4@mail.gmail.com> Date: Fri, 22 Jun 2007 16:46:06 +0200 From: "Die Gestalt" To: freebsd-drivers@freebsd.org In-Reply-To: <5bf3e10d0706040455j2015a2dan685e7e80db66bd95@mail.gmail.com> MIME-Version: 1.0 References: <5bf3e10d0705150724q3f0fd25fq89094bd02d8f9d29@mail.gmail.com> <86veetgnk4.fsf@dwp.des.no> <5bf3e10d0705210744s119d1c5cpc20ab1036e9f98ff@mail.gmail.com> <5bf3e10d0705221130t222b80b5w64a4e446b04d6029@mail.gmail.com> <863b1nvqqa.fsf@dwp.des.no> <5bf3e10d0705230314w3038a532uf0d8c0ed18a5d05f@mail.gmail.com> <5bf3e10d0705240839x17792a96hf17e6eebfa5a83da@mail.gmail.com> <5bf3e10d0705241345t11e739we0b896bab868fec6@mail.gmail.com> <5bf3e10d0706010709yab08f21s256cb894118d3bf4@mail.gmail.com> <5bf3e10d0706040455j2015a2dan685e7e80db66bd95@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: Generic int 13h driver X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2007 14:46:08 -0000 w00t the driver is finished! I had to do some obscure things for the physical memory, but I made it work. I can mount partitions, etc. do whatever. I'll have to do some stress tests though. It's quite slow, but that's not horrible, around 5 MB/s. However multi threaded performance will be horrible because of the lock on physical memory. That could make a nice talk at a BSD conference. ;) From owner-freebsd-drivers@FreeBSD.ORG Sat Jun 23 18:22:37 2007 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8F89016A482 for ; Sat, 23 Jun 2007 18:22:37 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 7FC4E13C45A for ; Sat, 23 Jun 2007 18:22:37 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 10CF51A4D84; Sat, 23 Jun 2007 11:21:30 -0700 (PDT) Date: Sat, 23 Jun 2007 11:21:30 -0700 From: Alfred Perlstein To: Die Gestalt Message-ID: <20070623182130.GE55189@elvis.mu.org> References: <86veetgnk4.fsf@dwp.des.no> <5bf3e10d0705210744s119d1c5cpc20ab1036e9f98ff@mail.gmail.com> <5bf3e10d0705221130t222b80b5w64a4e446b04d6029@mail.gmail.com> <863b1nvqqa.fsf@dwp.des.no> <5bf3e10d0705230314w3038a532uf0d8c0ed18a5d05f@mail.gmail.com> <5bf3e10d0705240839x17792a96hf17e6eebfa5a83da@mail.gmail.com> <5bf3e10d0705241345t11e739we0b896bab868fec6@mail.gmail.com> <5bf3e10d0706010709yab08f21s256cb894118d3bf4@mail.gmail.com> <5bf3e10d0706040455j2015a2dan685e7e80db66bd95@mail.gmail.com> <5bf3e10d0706220746y1a114792scd1ec59b95ed0ca4@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5bf3e10d0706220746y1a114792scd1ec59b95ed0ca4@mail.gmail.com> User-Agent: Mutt/1.4.2.2i Cc: freebsd-drivers@freebsd.org Subject: Re: Generic int 13h driver X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2007 18:22:37 -0000 * Die Gestalt [070622 07:45] wrote: > w00t the driver is finished! I had to do some obscure things for the > physical memory, but I made it work. I can mount partitions, etc. do > whatever. I'll have to do some stress tests though. > > It's quite slow, but that's not horrible, around 5 MB/s. However multi > threaded performance will be horrible because of the lock on physical > memory. > > That could make a nice talk at a BSD conference. ;) It'd be even nicer in the tree... will that be possible? -- - Alfred Perlstein From owner-freebsd-drivers@FreeBSD.ORG Sat Jun 23 20:03:17 2007 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9B6F916A400 for ; Sat, 23 Jun 2007 20:03:17 +0000 (UTC) (envelope-from die.gestalt@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.183]) by mx1.freebsd.org (Postfix) with ESMTP id 5755413C46E for ; Sat, 23 Jun 2007 20:03:15 +0000 (UTC) (envelope-from die.gestalt@gmail.com) Received: by py-out-1112.google.com with SMTP id u77so1007660pyb for ; Sat, 23 Jun 2007 13:03:14 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=JiA22DFjml1/PK8zVYTnOgOsW6fq6cDShpoD45GOIGN2up2FfcN0aqoRbXtG0jujdSmaFKteWi0PmT6pUjECJGtdH2OUZY1vhzbCSWXuBuiTKoG0t7bHCfA6tVv9VZB8Y1hg8NWOnItLm7jedm7Dy7jKwd56+MJn63QCUJzmlk0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=sT6+UhO8uIhXV0CPMV92XTxdPAkypCZPAmG331a5oxuI7ZOQoudM+GalnxvRMnXQFHjjK6UlRYiXS3XbRQ8jY1FAl1TVBjgWlzOQ5D2OXaLbuW1+CdNxULjtmLzd0oBJDJl0FXmwNmB4lFW6K81tXdi5IPOdWYqTtnDWyuxVjT4= Received: by 10.65.254.5 with SMTP id g5mr7432004qbs.1182628994354; Sat, 23 Jun 2007 13:03:14 -0700 (PDT) Received: by 10.64.180.9 with HTTP; Sat, 23 Jun 2007 13:03:14 -0700 (PDT) Message-ID: <5bf3e10d0706231303q5c7f7128r8a0f82310f5bb7ad@mail.gmail.com> Date: Sat, 23 Jun 2007 22:03:14 +0200 From: "Die Gestalt" To: alfred@freebsd.org, freebsd-drivers@freebsd.org In-Reply-To: <20070623182130.GE55189@elvis.mu.org> MIME-Version: 1.0 References: <86veetgnk4.fsf@dwp.des.no> <5bf3e10d0705221130t222b80b5w64a4e446b04d6029@mail.gmail.com> <863b1nvqqa.fsf@dwp.des.no> <5bf3e10d0705230314w3038a532uf0d8c0ed18a5d05f@mail.gmail.com> <5bf3e10d0705240839x17792a96hf17e6eebfa5a83da@mail.gmail.com> <5bf3e10d0705241345t11e739we0b896bab868fec6@mail.gmail.com> <5bf3e10d0706010709yab08f21s256cb894118d3bf4@mail.gmail.com> <5bf3e10d0706040455j2015a2dan685e7e80db66bd95@mail.gmail.com> <5bf3e10d0706220746y1a114792scd1ec59b95ed0ca4@mail.gmail.com> <20070623182130.GE55189@elvis.mu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Re: Generic int 13h driver X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2007 20:03:17 -0000 Unlikely in the short term. I made this driver for my employer, I think there might be reluctance about releasing it to the public. On one hand this would most likely increase the quality of the code, on the other hand this might hurt us in helping competition. I know this would be cool since there are people out there who would like this feature. Right now the driver needs to be tested further. The number of machines on which it has been tested is ludicrously small (one virtual machine, one laptop). But anyways the thing that will prevent the driver from ending up in the tree is that my coding style doesn't respect FreeBSD rules (omg!). For the rest the driver correctly interfaces with GEOM via the disk(9) routines and the read and writes are queued in a working thread. On 6/23/07, Alfred Perlstein wrote: > > * Die Gestalt [070622 07:45] wrote: > > w00t the driver is finished! I had to do some obscure things for the > > physical memory, but I made it work. I can mount partitions, etc. do > > whatever. I'll have to do some stress tests though. > > > > It's quite slow, but that's not horrible, around 5 MB/s. However multi > > threaded performance will be horrible because of the lock on physical > > memory. > > > > That could make a nice talk at a BSD conference. ;) > > It'd be even nicer in the tree... will that be possible? > > -- > - Alfred Perlstein > From owner-freebsd-drivers@FreeBSD.ORG Sat Jun 23 23:44:28 2007 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E1CCC16A46E for ; Sat, 23 Jun 2007 23:44:28 +0000 (UTC) (envelope-from mureninc@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.251]) by mx1.freebsd.org (Postfix) with ESMTP id 5AE6313C4CB for ; Sat, 23 Jun 2007 23:44:28 +0000 (UTC) (envelope-from mureninc@gmail.com) Received: by an-out-0708.google.com with SMTP id c14so288062anc for ; Sat, 23 Jun 2007 16:44:27 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=rolE1fsZ50JCzuuw2sAYkHgvJjjbsyZ88qsb0q4H4smv1dhLlscbIJQiFLPe9nLG64kGJoAgDGJo3lCE6f2WZIu3AjNJ2b9YC+POtlshRijXukWoAQO2+eNvQ1W5QuG7Jo+QeqvTZycb0nl96bDlAsSSQKz03HTOq7l7K+mPEvM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=CfCbFS0yyH+LyhMfQcU4a959w3NGozUme2r+FKGeDiOFuFEhPe403tZVwrMzFmNsQC/nI52L1RE8pq+A2yAXLi1YmXLA3uIgKDzXQaic+4y7SC3s3PC8zhNZE5vVdG/OJmJppbcNL12P6AROYsGjXiNUmV2WfdhHDhg5gHMdf8c= Received: by 10.100.153.17 with SMTP id a17mr2398400ane.1182640575030; Sat, 23 Jun 2007 16:16:15 -0700 (PDT) Received: by 10.100.189.2 with HTTP; Sat, 23 Jun 2007 16:16:14 -0700 (PDT) Message-ID: Date: Sat, 23 Jun 2007 19:16:14 -0400 From: "Constantine A. Murenin" To: "Die Gestalt" In-Reply-To: <5bf3e10d0706231303q5c7f7128r8a0f82310f5bb7ad@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <86veetgnk4.fsf@dwp.des.no> <863b1nvqqa.fsf@dwp.des.no> <5bf3e10d0705230314w3038a532uf0d8c0ed18a5d05f@mail.gmail.com> <5bf3e10d0705240839x17792a96hf17e6eebfa5a83da@mail.gmail.com> <5bf3e10d0705241345t11e739we0b896bab868fec6@mail.gmail.com> <5bf3e10d0706010709yab08f21s256cb894118d3bf4@mail.gmail.com> <5bf3e10d0706040455j2015a2dan685e7e80db66bd95@mail.gmail.com> <5bf3e10d0706220746y1a114792scd1ec59b95ed0ca4@mail.gmail.com> <20070623182130.GE55189@elvis.mu.org> <5bf3e10d0706231303q5c7f7128r8a0f82310f5bb7ad@mail.gmail.com> Cc: freebsd-drivers@freebsd.org Subject: Re: Generic int 13h driver X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2007 23:44:29 -0000 On 23/06/07, Die Gestalt wrote: > Unlikely in the short term. I made this driver for my employer, I think > there might be reluctance about releasing it to the public. On one hand this > would most likely increase the quality of the code, on the other hand this > might hurt us in helping competition. I know this would be cool since there > are people out there who would like this feature. Keep in mind that not giving the code away to FreeBSD might make future merging of the code more difficult for your employer, hence once more reason for you to release the code. :) Cheers, Constantine.