<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>BIOSism</title>
	<link>http://biosism.com</link>
	<description>One of a kind 'low level' religion!</description>
	<pubDate>Thu, 07 Oct 2010 05:58:02 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>
	<language>en</language>
			<item>
		<title>BIOS/Firmware Class</title>
		<link>http://biosism.com/20101007/biosfirmware-class/</link>
		<comments>http://biosism.com/20101007/biosfirmware-class/#comments</comments>
		<pubDate>Thu, 07 Oct 2010 05:58:02 +0000</pubDate>
		<dc:creator>Sivagar</dc:creator>
		
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://biosism.com/20101007/biosfirmware-class/</guid>
		<description><![CDATA[First of all thanks to all of you for the comments!  I will look into the suggestions and give my feedback on each of them.
So the class in UCSC is confirmed for Winter 2011.  You can find more information about it here.
Today I ordered Beagle Board with touch screen.  I am going to play with [...]]]></description>
			<content:encoded><![CDATA[<p>First of all thanks to all of you for the comments!  I will look into the suggestions and give my feedback on each of them.</p>
<p>So the class in UCSC is confirmed for Winter 2011.  You can find more information about it <a href="http://courses.ucsc-extension.edu/ucsc/public/category/courseDetails.do?method=load&amp;courseId=4898309&amp;selectedCategoryId=1000075&amp;selectedProgramAreaId=1000180&amp;selectedProgramStreamId=1535396" title="Winter 2011 BIOS/Firmware class in UCSC" target="_blank">here</a>.</p>
<p>Today I ordered Beagle Board with touch screen.  I am going to play with it and see whether I can use it for developing some UEFI drivers/applications.</p>
<p>Stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://biosism.com/20101007/biosfirmware-class/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Teaching BIOS/Firmware in UCSC Extension</title>
		<link>http://biosism.com/20100520/teaching-biosfirmware-in-ucsc-extension/</link>
		<comments>http://biosism.com/20100520/teaching-biosfirmware-in-ucsc-extension/#comments</comments>
		<pubDate>Thu, 20 May 2010 08:17:47 +0000</pubDate>
		<dc:creator>Sivagar</dc:creator>
		
		<category><![CDATA[BIOS]]></category>

		<guid isPermaLink="false">http://biosism.com/20100520/teaching-biosfirmware-in-ucsc-extension/</guid>
		<description><![CDATA[Recently I was toying with the idea of teaching BIOS/UEFI in UCSC Extension, Santa Clara.  The Director of the Institute is very receptive of the idea.   I was thinking of adding the course as part of the Embedded Systems.  I had trained Engineers in BIOS/UEFI before as part of my previous job.  But teaching [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was toying with the idea of teaching BIOS/UEFI in <a href="http://www.ucsc-extension.edu/" target="_blank">UCSC Extension</a>, Santa Clara.  The Director of the Institute is very receptive of the idea.   I was thinking of adding the course as part of the Embedded Systems.  I had trained Engineers in BIOS/UEFI before as part of my previous job.  But teaching in the university to professionals is different.  I still couldn&#8217;t figure out the right set of curriculum that will be widely received. Then comes the issue of development boards and source.</p>
<p>Regarding curriculum, legacy BIOS is slowly phased out for UEFI.  Except for some standard things most part of legacy BIOS is proprietary.  It makes more sense to start basics of firmware and move to UEFI.  The following are the topics I was considering as part of legacy BIOS:</p>
<ul>
<li>History of BIOS and its evolution</li>
<li>BIOS architecture:  memory footprint and architecture</li>
<li>BIOS Hardware and Software  Interrupts</li>
<li>BIOS Device Enumeration and Configuration</li>
<li>Option  ROM and its interfaces</li>
<li>BIOS and option ROM limitation</li>
<li>Boot  options and methods</li>
<li>BIOS Runtime Services</li>
<li>ACPI &amp;  SMBIOS</li>
</ul>
<p>For UEFI,</p>
<ul>
<li>UEFI and its history</li>
<li>UEFI Architecture</li>
<li>Boot  &amp; Runtime Services</li>
<li>Understanding UEFI driver architecture</li>
<li>Writing  UEFI drivers and UEFI applications</li>
<li>UEFI debugging methodologies</li>
</ul>
<p>Finally end the course with a brief section on U-Boot and ARM architecture.</p>
<p>It will be boring not to have any practical lab sessions.  Unfortunately it requires a board and source to test it out.  For ARM, I found <a href="http://beagleboard.org" target="_blank">Beagle Board</a> a good choice, it has UEFI port and has U-Boot support.  It will be great if I can find a PC based architecture for less than 100$ with relevant UEFI source.  For UEFI, Tiano will be my choice but open source version does not have all the drivers required to boot a board.  Another choice will be use some emulator.</p>
<p>I have close to 6 months to finalize on all this things.  Any suggestion on curriculum or board/source choice?</p>
]]></content:encoded>
			<wfw:commentRss>http://biosism.com/20100520/teaching-biosfirmware-in-ucsc-extension/feed/</wfw:commentRss>
		</item>
		<item>
		<title>(-1) Your number is up!</title>
		<link>http://biosism.com/20100413/1-your-number-is-up/</link>
		<comments>http://biosism.com/20100413/1-your-number-is-up/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 04:29:03 +0000</pubDate>
		<dc:creator>B105XOR</dc:creator>
		
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://biosism.com/20100413/1-your-number-is-up/</guid>
		<description><![CDATA[(This is a guest posting from my good friend Robert Rauch!)
In the BIOS/EFI world the &#8220;old hats&#8221; cut their teeth on x86 assembly where (-1) is an insightful shortcut to (11&#8230;111b).  However, today&#8217;s BIOS (now called EFI) is written in &#8220;C&#8221;.  Unlike assembly, in &#8220;C&#8221; the watch word is portability.  Whenever possible, good &#8220;C&#8221; MUST [...]]]></description>
			<content:encoded><![CDATA[<p><em>(This is a guest posting from my good friend Robert Rauch!)</em></p>
<p>In the BIOS/EFI world the &#8220;old hats&#8221; cut their teeth on x86 assembly where (-1) is an insightful shortcut to (11&#8230;111b).  However, today&#8217;s BIOS (now called EFI) is written in &#8220;C&#8221;.  Unlike assembly, in &#8220;C&#8221; the watch word is portability.  Whenever possible, good &#8220;C&#8221; MUST be written without consideration of the compiler or the target hardware.  In &#8220;C&#8221;, if (-1) gives the proper binary number it is simply a matter of luck.  To get around a &#8220;bug&#8221; in the .Net compiler, you will often see these &#8220;fixes&#8221;:</p>
<p><font face="Courier New">(unsigned long long)(-1);</font></p>
<p><font face="Courier New">(UINT64)(-1);</font></p>
<p>However, if you consider that there is no universal negative binary notation, you will realize that it is beyond the scope of &#8220;C&#8221; to specify how any compiler maps any negative number into binary.  Considering these facts, you must agree that this is not a &#8220;bug&#8221; in the .Net compiler after all, it is simply luck that has run out.  I am all about holding MS accountable for their bugs, when they are real bugs.  Fortunately, &#8220;C&#8221; has a compiler agnostic, hardware portable, short cut that exactly fills the same desired purpose:</p>
<p><font face="Courier New">(~0);</font></p>
<p>(~0) is the shortest VALID way to express (11&#8230;111b) in &#8220;C&#8221;.  After all, how &#8220;short&#8221; is a short cut that has to be cast 3 ways &#8217;till Sunday and why count on being lucky?</p>
]]></content:encoded>
			<wfw:commentRss>http://biosism.com/20100413/1-your-number-is-up/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Better Code</title>
		<link>http://biosism.com/20100122/better-code/</link>
		<comments>http://biosism.com/20100122/better-code/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 22:10:18 +0000</pubDate>
		<dc:creator>Sivagar</dc:creator>
		
		<category><![CDATA[Unittest]]></category>

		<category><![CDATA[BIOS]]></category>

		<guid isPermaLink="false">http://biosism.com/20100122/better-code/</guid>
		<description><![CDATA[ This is a cross post of my blog in biosdevelopers.com. 
I had seen lot of BIOS rewrites in my professional life. I am specifically talking about PC BIOS. We all started with uncompressed BIOS image, then moved to compressed image to fit in existing flash (EEPROM at that time) chip. Then we need to move [...]]]></description>
			<content:encoded><![CDATA[<p> <em>This is a cross post of my blog in biosdevelopers.com. </em></p>
<p>I had seen lot of BIOS rewrites in my professional life. I am specifically talking about PC BIOS. We all started with uncompressed BIOS image, then moved to compressed image to fit in existing flash (EEPROM at that time) chip. Then we need to move the BIOS out of x86 segment limitations. There was a rewrite for new technologies such as ACPI, USB etc.</p>
<p>Every time we rewrite the BIOS code base everything seems to be fine and clean. After couple of years, the code look ugly with lot of patches here and there, new features are poured over without proper code rearrangement etc. By this time the original developers/designers of that code will not be in the project. They (rather we) always look at the code and say.. Oh.. it is not our fault we did provide a clean proper solution it is the new Engineers who ruined the code; they don&#8217;t know what they are doing!</p>
<p>Even though it is true in some sense but from <a href="http://en.wikipedia.org/wiki/Robert_Cecil_Martin">Robert C Martin</a>&#8217;s foreword in the book &#8216;<a href="http://books.google.com/books?id=CQlRAAAAMAAJ&amp;q=Working+effectively+with+Legacy+code&amp;dq=Working+effectively+with+Legacy+code&amp;ots=vFRYmPIolC&amp;sig=ywmRJC1195i4ZrYMNHcLWAOBk38&amp;hl=en&amp;ei=T2RYS6SmF4XGsQOcp6TGBw&amp;sa=X&amp;oi=book_result&amp;ct=result&amp;resnum=1&amp;ved=0CC0Q6AEwAA">Working Effectively with Legacy Code</a>&#8216; by Michael C Feathers:<br />
<span style="font-style: italic"> &#8220;Designs that cannot tolerate changing requirements are poor designs to begin with. It is the goal of every competent software developer to create designs that tolerate change&#8221;</span></p>
<p>Apparently the original developers (that includes me too) are not &#8216;competent&#8217; enough. I started seeing similar pattern in the EFI/UEFI code base already. Backward compatibility, newer chipset support, new protocols, new specifications etc are rapidly ruining the original code base. In many cases, the original design goal are not met anymore as original Engineers moved away and the design spirit didn&#8217;t distilled down to new Engineers! I see a serious problem here!</p>
<p>How to fix it? One common suggestion will be better documentation! Well, frankly how many people really read documentations, really? I think better way to handle this will be to incorporate proven software Engineering technologies. Coding standards should include Software Engineering technologies like Test Driven Development, Defensive programming etc, in addition to what to capitalize and how long should be the variables.</p>
<p>One basic thing that can help is unit testing. I used to say.. unit testing in the BIOS - that&#8217;s impossible! We need actual hardware to test the code nothing can replace the actual hardware! This is true.. but we can simulate most of the condition even before hardware arrive using mocks. Already we see an advantage here - Time-to-market is reduced since we don&#8217;t need to wait till hardware, we can already test our code!</p>
<p><span style="font-weight: bold; font-size: 130%"><span style="font-size: 100%">What are unit tests?</span></span> Unit tests are tests in isolation. They are not big tests. They run complete in fraction of a second and test just a procedure. They localize the issues. If your test is for more than a procedure than it basically not an unit test.</p>
<p><span style="font-weight: bold">How are they useful?</span> Think about a procedure written with an unit test. The test that verifies various inputs and outputs in a contained fashion. Later another Engineer wants to change this procedure, he/she can do the change and run the unit test (normally unit tests are run as part of build process) to make sure the original functionality is kept intact. Also from the unit tests she/he can understand what the original intent of the procedure. This &#8216;original intent&#8217; helps a lot in future code updates!</p>
<p>There are lot of benefits I can say about unit tests.. let us keep that for our next post. Also I will write more about what tools are available for unit tests and how to write better unit tests in my future posts. If you&#8217;re impatient read the <a href="http://books.google.com/books?id=CQlRAAAAMAAJ&amp;q=Working+effectively+with+Legacy+code&amp;dq=Working+effectively+with+Legacy+code&amp;ots=vFRYmPIolC&amp;sig=ywmRJC1195i4ZrYMNHcLWAOBk38&amp;hl=en&amp;ei=T2RYS6SmF4XGsQOcp6TGBw&amp;sa=X&amp;oi=book_result&amp;ct=result&amp;resnum=1&amp;ved=0CC0Q6AEwAA">book</a> and check out <a href="http://code.google.com/p/cmockery/">cMockery</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://biosism.com/20100122/better-code/feed/</wfw:commentRss>
		</item>
		<item>
		<title>USB 101 - Specifications</title>
		<link>http://biosism.com/20090312/usb-101-specifications/</link>
		<comments>http://biosism.com/20090312/usb-101-specifications/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 16:43:00 +0000</pubDate>
		<dc:creator>Sivagar</dc:creator>
		
		<category><![CDATA[USB]]></category>

		<category><![CDATA[Host Controllers]]></category>

		<category><![CDATA[Technical]]></category>

		<category><![CDATA[System Software]]></category>

		<guid isPermaLink="false">http://biosism.com/2009/03/12/usb-101-specifications/</guid>
		<description><![CDATA[One of the major project I did in AMI is implementing USB 2.0 for AMIBIOS8.  It was a wonderful adventure to learn USB and to be able to implement the host controller support from scratch.  Programming for USB controller seems like a daunting task but if we get the basic operations of USB [...]]]></description>
			<content:encoded><![CDATA[<p>One of the major project I did in AMI is implementing USB 2.0 for AMIBIOS8.  It was a wonderful adventure to learn USB and to be able to implement the host controller support from scratch.  Programming for USB controller seems like a daunting task but if we get the basic operations of USB controller then it is very simple.</p>
<p>USB specification is not a good point to start.  I find it is better to start with OHCI (Open Host Controller Interface) specification, then move to EHCI (Enhanced..) and finally to USB specification.  Let us see what these specifications talk about and how it will help us to understand the USB itself.</p>
<p>USB Specification:<br />
The USB specification defines the things starting from the USB connector on the board to the device.  It details mechanical, electrical and communication protocol of the USB bus.  Meaning it explains the various USB connectors (A, B, mini-A etc),  bus characteristics,  data transmission details etc.  The latest specification version is 3.0.  This 3.0 specification covers 4 different USB speeds such as:</p>
<ul>
<li>Low speed (1.5 Mb/s) - keyboard, mouse etc</li>
<li>Full speed (12 Mb/s) - USB 1.1 flash drive</li>
<li>High speed (480 Mb/s) - USB 2.0 flash drive</li>
<li>Super Speed (5 Gb/s) - Newer devices</li>
</ul>
<p>Host controller specifications:<br />
The host controller specification talks about how actually software talks to the USB bus.  It defines the hardware interface through which the system software (OS, BIOS etc) can communicate through the USB bus.  There are 4 types of host controllers as below:</p>
<ul>
<li>Universal Host Controller Interface (UHCI) - During USB 1.1 specification time frame there was split between hardware vendors on Host Controller Interface agreements, thus two different specifications were created and supported by different companies.  UHCI is one of those two specifications and it is supported in Intel Chipsets.  As this is the very first Host Controller interface this is one of the badly designed host controller interface (in my opinion). It supports only low &amp; full speed otherwise called USB 1.1 speeds.</li>
<li>Open Host Controller Interface (OHCI) - Competitor to the UHCI specification, this is supported by AMD, Compaq and others.  This is elegantly designed and easy to program when compared to UHCI.  It supports USB 1.1 speeds only</li>
<li>Enhanced Host Controller Interface (EHCI) - This supports USB 2.0 speed aka high speed. Luckily for the software developers there is only one 2.0 Host Controller.  This utilizes most of the OHCI approach and thus easy to program.</li>
<li>eXtensible Host Controller Interface (XHCI) - This host controller supports new USB 3.0 speed aka super speed.  I didn&#8217;t look at the specification yet as it is not publicly available.  This specification was almost split up just like USB 1.1 controllers but saved at the last moment - that is what I heard!</li>
</ul>
<p>Mostly System Software Engineers need to worry about how to communicate through the host controller interface.  It is more like when you start programming serial port first thing we want to learn is the programming interface, how to set the transmission speed, how to receive a byte or transmit a byte etc.   It is same in USB too.</p>
<p>As the main goal of USB is to support wide range of devices connected to a same connector, the complexity of identifying and configuring devices falls under software stack.  The USB specification tells you how to generate a meaningful generic (in the sense of device types) communication in the USB bus.  There are various other specifications which details communication details for various type of devices like Human Interface Devices (HID) such as keyboard, mouse etc, Mass Storage Devices such as CDROM, flash drives etc.</p>
<p>In the next post I will discuss more into communication details.</p>
]]></content:encoded>
			<wfw:commentRss>http://biosism.com/20090312/usb-101-specifications/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Needle in the haystack!</title>
		<link>http://biosism.com/20090121/needle-in-the-haystack/</link>
		<comments>http://biosism.com/20090121/needle-in-the-haystack/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 07:28:00 +0000</pubDate>
		<dc:creator>Sivagar</dc:creator>
		
		<category><![CDATA[Specifications]]></category>

		<category><![CDATA[BIOS]]></category>

		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://biosism.com/2009/01/21/needle-in-the-haystack/</guid>
		<description><![CDATA[Last week my co-worker and me searched the internet for the document that lists all the PnP ID (used in ACPI mostly).  It took for both of us a while to get that document, supposed to be maintained by Microsoft.   It is maintained as a text document hidden in MSDN documentation online. [...]]]></description>
			<content:encoded><![CDATA[<p>Last week my co-worker and me searched the internet for the document that lists all the PnP ID (used in ACPI mostly).  It took for both of us a while to get that document, supposed to be maintained by Microsoft.   It is maintained as a text document hidden in MSDN documentation online.   That made me think about other specifications and documents - we, the BIOS Engineers search time to time.</p>
<p>All those documents are scattered in 100&#8217;s of websites. I decided to create a link to those documents in one of my blog post here and maintain it!  Let us see how it goes.. if you have any suggestions/corrections let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://biosism.com/20090121/needle-in-the-haystack/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Size does matter!</title>
		<link>http://biosism.com/20090115/size-does-matter/</link>
		<comments>http://biosism.com/20090115/size-does-matter/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 07:06:00 +0000</pubDate>
		<dc:creator>Sivagar</dc:creator>
		
		<category><![CDATA[BIOS]]></category>

		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://biosism.com/2009/01/15/size-does-matter/</guid>
		<description><![CDATA[Around 1992 the BIOS vendors started to compress part of their BIOS.  Before that the BIOS was uncompressed and kept in 64KB EPROM.  I remembered spending lot of time in EPROM UV erasers and blank checking the EPROMs.
During the early stage of the BIOS there are not many chips to initialize.  Memory [...]]]></description>
			<content:encoded><![CDATA[<p>Around 1992 the BIOS vendors started to compress part of their BIOS.  Before that the BIOS was uncompressed and kept in 64KB EPROM.  I remembered spending lot of time in EPROM UV erasers and blank checking the EPROMs.</p>
<p>During the early stage of the BIOS there are not many chips to initialize.  Memory detection is simple and straight forward, super I/O  initialization is simple and nothing to enumerate - most of the configuration is through hardware jumpers.  So 64KB was enough and it is kept as a &#8216;tiny&#8217; memory model - single 64KB segment!  Since the ROM is an EPROM no worry of corruption and thus no hardware protected boot block!</p>
<p>When more companies started making x86 clone CPUs, introduction of various storage formats (5 1/4, 3 1/2 Floppy drives,  various HDD drives) and PnP buses (ISA PnP anyone?) made BIOS size grew dramatically.  Every extra byte was squeezed out of BIOS.  BIOS vendors started providing OEM with tools to select what CPU support they need in their BIOS.  There was a time when people can choose 8 different CPU vendors each with different flavors of 386 or 486 compatible chips.</p>
<p>Compressing a certain portion of the BIOS was the only solution at that time.  Initially only a very small portion of the BIOS was compressed.  BIOS code was also separated into boot (or POST) and runtime code at this time.  Mostly runtime code was compressed.  Boot and runtime code were kept in two different segments.  Boot code normally invokes runtime code using a single entry point with function numbers.  The boot code should wait till runtime code gets uncompressed before using this interface.  This was an ugly implementation that lived for quite sometime.</p>
<p>The main design choice for this ugly idea was Time-To-Market (famous TTM).  There were not much Engineers to do parallel development of a better BIOS core (at least in the company I worked for).  It worked perfectly for 1/2 decade, then the interface got uglier and EEPROM size increased to 128KB in newer systems.  At this point, BIOS moved out of Shadow RAM and into RAM.</p>
<p>For a while it looked like we had lot of space both in ROM &amp; in RAM, but not for long!</p>
]]></content:encoded>
			<wfw:commentRss>http://biosism.com/20090115/size-does-matter/feed/</wfw:commentRss>
		</item>
		<item>
		<title>BIOS and me!</title>
		<link>http://biosism.com/20090110/bios-and-me/</link>
		<comments>http://biosism.com/20090110/bios-and-me/#comments</comments>
		<pubDate>Sat, 10 Jan 2009 08:20:00 +0000</pubDate>
		<dc:creator>Sivagar</dc:creator>
		
		<category><![CDATA[Personal]]></category>

		<category><![CDATA[BIOS]]></category>

		<guid isPermaLink="false">http://biosism.com/2009/01/10/bios-and-me/</guid>
		<description><![CDATA[My first contact with BIOS was with my final year under grad project in 1992.  Our project is to create a compressed disk by hooking to INT13h handler for MS-DOS.  It was fun playing with low level interrupts and x86 Assembly.
After graduation my first job was mainly with Unix System V &#38; SCO [...]]]></description>
			<content:encoded><![CDATA[<p>My first contact with BIOS was with my final year under grad project in 1992.  Our project is to create a compressed disk by hooking to INT13h handler for MS-DOS.  It was fun playing with low level interrupts and x86 Assembly.</p>
<p>After graduation my first job was mainly with Unix System V &amp; SCO Unix.  Next job was in Networking drivers.. where I worked with fun MS-DOS/Windows 3.1 technologies like Extended Memory, Expanded Memory &amp; Cloaking - art of using 32bit code/data in MS-DOS.  I lasted a year each in my first two jobs.</p>
<p>Then I got my contact with BIOS again in my third job in 1995.  It was a long affair with BIOS from that time.  I was with that company till 2007 worked in various locations.  I might soon move away from BIOS as full time job.  This blog - biosism - is my journey to past into this world of &#8216;neglected elitism&#8217;.</p>
]]></content:encoded>
			<wfw:commentRss>http://biosism.com/20090110/bios-and-me/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

