tag:blogger.com,1999:blog-142971472024-03-06T08:57:59.037+05:30LEXOSAlexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.comBlogger26125tag:blogger.com,1999:blog-14297147.post-12940278421554822572011-09-14T15:46:00.000+05:302011-09-14T15:46:41.550+05:30Bootloader<div dir="ltr" style="text-align: left;" trbidi="on">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">The below assembly code loads the secondary bootloader (boot2.bin) at address 0x8000 from the FAT12 filesystem and jumps to it.</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;_______________________________________________</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; File name<span class="Apple-tab-span" style="white-space: pre;"> </span> : boot.asm<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; Authour<span class="Apple-tab-span" style="white-space: pre;"> </span> : M.Alexander<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; Mail<span class="Apple-tab-span" style="white-space: pre;"> </span> : programmer_83@hotmail.com<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; Date<span class="Apple-tab-span" style="white-space: pre;"> </span> : 09-05-2004<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; Description : Primary Bootloader<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;_______________________________________________|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">[BITS 16]</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;<span class="Apple-tab-span" style="white-space: pre;"> </span> Memory Map</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;_______________________________________________</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; _____________________<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; | <span class="Apple-tab-span" style="white-space: pre;"> </span> | <-- 0x0000<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; | <span class="Apple-tab-span" style="white-space: pre;"> </span> |<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; | STACK<span class="Apple-tab-span" style="white-space: pre;"> </span> |<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; | <span class="Apple-tab-span" style="white-space: pre;"> </span> |<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; |_____________________| <-- 0x05FF<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; | <span class="Apple-tab-span" style="white-space: pre;"> </span> | <-- 0x0600<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; | FAT COPY<span class="Apple-tab-span" style="white-space: pre;"> </span> |<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; |_____________________| <-- 0x1800<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; |////////UNUSED///////|<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; |_____________________| <-- 0x2000<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; | <span class="Apple-tab-span" style="white-space: pre;"> </span> |<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; | ROOT DIRECTORY |<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; |_____________________| <-- 0x3C00<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; |/////////////////////|<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; |////////UNUSED///////|<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; |/////////////////////|<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; |_____________________| <-- 0x7C00<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; | <span class="Apple-tab-span" style="white-space: pre;"> </span> |<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; | PRIMARY BOOTLOADER |<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; |_____________________| <-- 0x7E00<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; |/////////////////////|<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; |///////UNUSED////////|<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; |/////////////////////|<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; |_____________________| <-- 0x8000<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; | <span class="Apple-tab-span" style="white-space: pre;"> </span> |<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; |SECONDARY BOOTLOADER |<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; |_____________________| <-- ??<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;<span class="Apple-tab-span" style="white-space: pre;"> </span>|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;_______________________________________________/</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">%define FAT_CPY 0x0600</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">%define DIR_CPY 0x2000</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">%define SEC_BL<span class="Apple-tab-span" style="white-space: pre;"> </span>0x8000</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">[org 0x7C00]</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>jmp short start</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>nop</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">OEM_IDENT<span class="Apple-tab-span" style="white-space: pre;"> </span>db<span class="Apple-tab-span" style="white-space: pre;"> </span>'FAT12FLP'</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">BYTES_PER_SCT<span class="Apple-tab-span" style="white-space: pre;"> </span>dw<span class="Apple-tab-span" style="white-space: pre;"> </span>0200h</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">SCTS_PER_CLST<span class="Apple-tab-span" style="white-space: pre;"> </span>db<span class="Apple-tab-span" style="white-space: pre;"> </span>01h</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">RESERVED_SCTS<span class="Apple-tab-span" style="white-space: pre;"> </span>dw<span class="Apple-tab-span" style="white-space: pre;"> </span>01h</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">NO_OF_FATS<span class="Apple-tab-span" style="white-space: pre;"> </span>db<span class="Apple-tab-span" style="white-space: pre;"> </span>02h</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">ROOT_ENT<span class="Apple-tab-span" style="white-space: pre;"> </span>dw<span class="Apple-tab-span" style="white-space: pre;"> </span>0E0h</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">NO_OF_SCTS<span class="Apple-tab-span" style="white-space: pre;"> </span>dw<span class="Apple-tab-span" style="white-space: pre;"> </span>0B40h</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">MEDIA_DCPTR<span class="Apple-tab-span" style="white-space: pre;"> </span>db<span class="Apple-tab-span" style="white-space: pre;"> </span>0F0h</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">SCTS_PER_FAT<span class="Apple-tab-span" style="white-space: pre;"> </span>dw<span class="Apple-tab-span" style="white-space: pre;"> </span>09h</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">SCTS_PER_TRK<span class="Apple-tab-span" style="white-space: pre;"> </span>dw<span class="Apple-tab-span" style="white-space: pre;"> </span>012h</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">HDS_PER_CYL<span class="Apple-tab-span" style="white-space: pre;"> </span>dw<span class="Apple-tab-span" style="white-space: pre;"> </span>02h</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">HDN_SCTS<span class="Apple-tab-span" style="white-space: pre;"> </span>dd<span class="Apple-tab-span" style="white-space: pre;"> </span>0h</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">start:</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>ax, 0</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>ds, ax</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>es, ax</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>ss, ax<span class="Apple-tab-span" style="white-space: pre;"> </span> ; Initialize segment registers</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>ax, 0x5ff</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>sp, ax<span class="Apple-tab-span" style="white-space: pre;"> </span> ; Setup Stack space</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>sti<span class="Apple-tab-span" style="white-space: pre;"> </span> ; Enable Interrupts</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;____________________________________________________________.</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; Loads FAT copy into main memory at address 0x0600 |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;____________________________________________________________|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>xor<span class="Apple-tab-span" style="white-space: pre;"> </span>ax, ax</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>add<span class="Apple-tab-span" style="white-space: pre;"> </span>word ax, [RESERVED_SCTS]</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>call<span class="Apple-tab-span" style="white-space: pre;"> </span>trans_add</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>ah, 0x02</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>al, [SCTS_PER_FAT]</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>dl, 0x00</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>bx, FAT_CPY</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>int<span class="Apple-tab-span" style="white-space: pre;"> </span>13h</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;____________________________________________________________.</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; Loads Directory Entries into main memory at<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; address 0x0600<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;____________________________________________________________|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>al, [SCTS_PER_FAT]</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mul<span class="Apple-tab-span" style="white-space: pre;"> </span>byte [NO_OF_FATS]</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>add<span class="Apple-tab-span" style="white-space: pre;"> </span>word ax, [RESERVED_SCTS]</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>call<span class="Apple-tab-span" style="white-space: pre;"> </span>trans_add</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>ah, 0x02</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>al, 0x0E</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>dl, 0x00</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>bx, DIR_CPY</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>int<span class="Apple-tab-span" style="white-space: pre;"> </span>13h</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;____________________________________________________________.</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; Calculates the start of data area and saves it in the |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; variable DATA_AREA for future use.<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;____________________________________________________________|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>ax, [SCTS_PER_FAT]</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>bx, [NO_OF_FATS]</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mul<span class="Apple-tab-span" style="white-space: pre;"> </span>bx</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>add<span class="Apple-tab-span" style="white-space: pre;"> </span>ax, [RESERVED_SCTS]</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>bx, ax</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>ax, [ROOT_ENT]</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>shl<span class="Apple-tab-span" style="white-space: pre;"> </span>ax, 0x05</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>shr<span class="Apple-tab-span" style="white-space: pre;"> </span>ax, 0x09</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>add<span class="Apple-tab-span" style="white-space: pre;"> </span>ax, bx</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>[DATA_AREA], ax</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;____________________________________________________________.</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; Searching for the secondary file begins here.<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;____________________________________________________________|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>bx, [ROOT_ENT]<span class="Apple-tab-span" style="white-space: pre;"> </span>; Move the number of root entries into bx (counter)</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>dx, DIR_CPY<span class="Apple-tab-span" style="white-space: pre;"> </span>; Move the address of Directory entry into dx</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">srch:</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>cld<span class="Apple-tab-span" style="white-space: pre;"> </span>; Clear the direction flag</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>di, sec_file<span class="Apple-tab-span" style="white-space: pre;"> </span>; Move the address of the secondary file into di</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>si, dx<span class="Apple-tab-span" style="white-space: pre;"> </span>; Load the source address</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>cx, 0x0b<span class="Apple-tab-span" style="white-space: pre;"> </span>; Number of characters to compare (8+3)</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>repe<span class="Apple-tab-span" style="white-space: pre;"> </span>cmpsb<span class="Apple-tab-span" style="white-space: pre;"> </span>; Repeat till the characters not equal. Maximum 0x0b times</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>jnz<span class="Apple-tab-span" style="white-space: pre;"> </span>short next<span class="Apple-tab-span" style="white-space: pre;"> </span>; If not found, try next entry</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;____________________________________________________________.</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; Loads the secondary file at the address SEC_BL declared |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; earlier.<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;____________________________________________________________|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>bx, SEC_BL</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>si, dx</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>add<span class="Apple-tab-span" style="white-space: pre;"> </span>si, 0x1A<span class="Apple-tab-span" style="white-space: pre;"> </span>; Byte 26 & 27 of the file entry</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>word ax,[si]<span class="Apple-tab-span" style="white-space: pre;"> </span>; (Entry cluster value)</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>push<span class="Apple-tab-span" style="white-space: pre;"> </span>ax<span class="Apple-tab-span" style="white-space: pre;"> </span>; Push the starting cluster to the stack</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">load:</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>xor<span class="Apple-tab-span" style="white-space: pre;"> </span>eax, eax</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>xor<span class="Apple-tab-span" style="white-space: pre;"> </span>ecx, ecx</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>xor<span class="Apple-tab-span" style="white-space: pre;"> </span>dx, dx<span class="Apple-tab-span" style="white-space: pre;"> </span>; Clear out necessary registers</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>pop<span class="Apple-tab-span" style="white-space: pre;"> </span>ax<span class="Apple-tab-span" style="white-space: pre;"> </span>; Pop the last computed value for the sector</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>push<span class="Apple-tab-span" style="white-space: pre;"> </span>ax<span class="Apple-tab-span" style="white-space: pre;"> </span>; Again save it for future use</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>cmp<span class="Apple-tab-span" style="white-space: pre;"> </span>ax, 0x0FFF<span class="Apple-tab-span" style="white-space: pre;"> </span>; If End of sector for the file, jump to exit</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>jz<span class="Apple-tab-span" style="white-space: pre;"> </span>exit</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>cl, [DATA_AREA]</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>dec<span class="Apple-tab-span" style="white-space: pre;"> </span>ax</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>dec<span class="Apple-tab-span" style="white-space: pre;"> </span>ax<span class="Apple-tab-span" style="white-space: pre;"> </span>; Subtract 2 from the next sector value</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>add<span class="Apple-tab-span" style="white-space: pre;"> </span>ax, cx<span class="Apple-tab-span" style="white-space: pre;"> </span>; Converts the data sector into LBA</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>call<span class="Apple-tab-span" style="white-space: pre;"> </span>trans_add<span class="Apple-tab-span" style="white-space: pre;"> </span>; Converts LBA into CHS</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>ax, 0x0201</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>dl, 0x00</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>int<span class="Apple-tab-span" style="white-space: pre;"> </span>13h<span class="Apple-tab-span" style="white-space: pre;"> </span>; Read the next data cluster into the main memory</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>add<span class="Apple-tab-span" style="white-space: pre;"> </span>bx, 0x200<span class="Apple-tab-span" style="white-space: pre;"> </span>; Increment the file pointer to load the sector</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>xor<span class="Apple-tab-span" style="white-space: pre;"> </span>ax, ax</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>pop<span class="Apple-tab-span" style="white-space: pre;"> </span>ax<span class="Apple-tab-span" style="white-space: pre;"> </span>; Pop the sector value from the stack</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>cx, 0x03</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mul<span class="Apple-tab-span" style="white-space: pre;"> </span>cx<span class="Apple-tab-span" style="white-space: pre;"> </span>; Multiply the value with 3</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>rcr<span class="Apple-tab-span" style="white-space: pre;"> </span>ax, 1<span class="Apple-tab-span" style="white-space: pre;"> </span>; Divide it by 2 (3/2 = 1.5)</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>jc<span class="Apple-tab-span" style="white-space: pre;"> </span>carry<span class="Apple-tab-span" style="white-space: pre;"> </span>; If carry set, decimal number</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>si, ax</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>add<span class="Apple-tab-span" style="white-space: pre;"> </span>si, 0x0600</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>word ax, [si]</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>and<span class="Apple-tab-span" style="white-space: pre;"> </span>ax, 0x0fff</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>push<span class="Apple-tab-span" style="white-space: pre;"> </span>ax</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>jmp<span class="Apple-tab-span" style="white-space: pre;"> </span>load</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">carry:</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>si, ax</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>add<span class="Apple-tab-span" style="white-space: pre;"> </span>si, 0x0600</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>word ax, [si]</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>shr<span class="Apple-tab-span" style="white-space: pre;"> </span>ax, 4</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>push<span class="Apple-tab-span" style="white-space: pre;"> </span>ax</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>jmp<span class="Apple-tab-span" style="white-space: pre;"> </span>load<span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>jmp<span class="Apple-tab-span" style="white-space: pre;"> </span>$<span class="Apple-tab-span" style="white-space: pre;"> </span>; File found. write code here</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">next:</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>dec<span class="Apple-tab-span" style="white-space: pre;"> </span>bx<span class="Apple-tab-span" style="white-space: pre;"> </span>; Decrement number of entries to check still</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>jz<span class="Apple-tab-span" style="white-space: pre;"> </span>exit<span class="Apple-tab-span" style="white-space: pre;"> </span>; If zero, file not found</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>add<span class="Apple-tab-span" style="white-space: pre;"> </span>dx, 0x20<span class="Apple-tab-span" style="white-space: pre;"> </span>; Point to next entry</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>jmp<span class="Apple-tab-span" style="white-space: pre;"> </span>short srch<span class="Apple-tab-span" style="white-space: pre;"> </span>; Compare next entry</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">exit:</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>jmp<span class="Apple-tab-span" style="white-space: pre;"> </span>0000:8000h<span class="Apple-tab-span" style="white-space: pre;"> </span>; Jump to secondary boot loader code</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">trans_add:</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;____________________________________________________________.</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; FUNCTION : Translates LBA sector number into CHS value |<span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; INPUT : AX = LBA Sector<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; OUTPUT : CH = Cylinder, DH = Head, CL = Sector<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; FORMULA USED:<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;<span class="Apple-tab-span" style="white-space: pre;"> </span> sector = (LBA % SPT) + 1<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;<span class="Apple-tab-span" style="white-space: pre;"> </span> Head<span class="Apple-tab-span" style="white-space: pre;"> </span> = (LBA / SPT) % HPC<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;<span class="Apple-tab-span" style="white-space: pre;"> </span> Cylinder = (LBA / SPT) / HPC<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;____________________________________________________________|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>div<span class="Apple-tab-span" style="white-space: pre;"> </span>word [SCTS_PER_TRK] ; LBA / SPT<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>inc<span class="Apple-tab-span" style="white-space: pre;"> </span>dl<span class="Apple-tab-span" style="white-space: pre;"> </span> ; dl = (LBA % SPT) + 1 |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>cl, dl<span class="Apple-tab-span" style="white-space: pre;"> </span> ; cl = sector<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>xor<span class="Apple-tab-span" style="white-space: pre;"> </span>dx, dx<span class="Apple-tab-span" style="white-space: pre;"> </span> ; Clear out dx reg. |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>div<span class="Apple-tab-span" style="white-space: pre;"> </span>word [HDS_PER_CYL] ; (LBA / SPT) / HPC |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>ch, al<span class="Apple-tab-span" style="white-space: pre;"> </span> ; ch = cylinder<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>dh, dl<span class="Apple-tab-span" style="white-space: pre;"> </span> ; dh = head<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>ret<span class="Apple-tab-span" style="white-space: pre;"> </span> ; Return<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;____________________________________________________________|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">print:</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;____________________________________________________________.</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; FUNCTION : Prints a string<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; INPUT : SI = String Address<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">; OUTPUT : Prints the string <span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;____________________________________________________________|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>push<span class="Apple-tab-span" style="white-space: pre;"> </span>ax<span class="Apple-tab-span" style="white-space: pre;"> </span>;<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>push<span class="Apple-tab-span" style="white-space: pre;"> </span>bx<span class="Apple-tab-span" style="white-space: pre;"> </span>;<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">pchar:<span class="Apple-tab-span" style="white-space: pre;"> </span>;<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>cld<span class="Apple-tab-span" style="white-space: pre;"> </span>;<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>lodsb<span class="Apple-tab-span" style="white-space: pre;"> </span>;<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>or<span class="Apple-tab-span" style="white-space: pre;"> </span>al, al<span class="Apple-tab-span" style="white-space: pre;"> </span>;<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>jz<span class="Apple-tab-span" style="white-space: pre;"> </span>pexit<span class="Apple-tab-span" style="white-space: pre;"> </span>;<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>ah, 0x0e<span class="Apple-tab-span" style="white-space: pre;"> </span>;<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mov<span class="Apple-tab-span" style="white-space: pre;"> </span>bx, 0x0007<span class="Apple-tab-span" style="white-space: pre;"> </span>;<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>int<span class="Apple-tab-span" style="white-space: pre;"> </span>10h<span class="Apple-tab-span" style="white-space: pre;"> </span>;<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>jmp<span class="Apple-tab-span" style="white-space: pre;"> </span>pchar<span class="Apple-tab-span" style="white-space: pre;"> </span>;<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">pexit:<span class="Apple-tab-span" style="white-space: pre;"> </span>;<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>pop<span class="Apple-tab-span" style="white-space: pre;"> </span>bx<span class="Apple-tab-span" style="white-space: pre;"> </span>;<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>pop<span class="Apple-tab-span" style="white-space: pre;"> </span>ax<span class="Apple-tab-span" style="white-space: pre;"> </span>;<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>ret<span class="Apple-tab-span" style="white-space: pre;"> </span>;<span class="Apple-tab-span" style="white-space: pre;"> </span> |</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">;____________________________________________________________|</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">sec_file<span class="Apple-tab-span" style="white-space: pre;"> </span>db<span class="Apple-tab-span" style="white-space: pre;"> </span>"BOOT2<span class="Apple-tab-span" style="white-space: pre;"> </span> BIN"</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">file_nt_fnd<span class="Apple-tab-span" style="white-space: pre;"> </span>db<span class="Apple-tab-span" style="white-space: pre;"> </span>CR,LF,'File not found',0</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">file_fnd<span class="Apple-tab-span" style="white-space: pre;"> </span>db<span class="Apple-tab-span" style="white-space: pre;"> </span>CR,LF,'File found',0</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">DATA_AREA<span class="Apple-tab-span" style="white-space: pre;"> </span>db<span class="Apple-tab-span" style="white-space: pre;"> </span>0x00</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">FILE_BUF<span class="Apple-tab-span" style="white-space: pre;"> </span>dw<span class="Apple-tab-span" style="white-space: pre;"> </span>0x8000</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">CR<span class="Apple-tab-span" style="white-space: pre;"> </span>equ<span class="Apple-tab-span" style="white-space: pre;"> </span>0x0d</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">LF<span class="Apple-tab-span" style="white-space: pre;"> </span>equ<span class="Apple-tab-span" style="white-space: pre;"> </span>0x0a</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">times(510-($-$$))<span class="Apple-tab-span" style="white-space: pre;"> </span>db<span class="Apple-tab-span" style="white-space: pre;"> </span> 0</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">dw<span class="Apple-tab-span" style="white-space: pre;"> </span>0xaa55</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
</div>
Alexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.com0tag:blogger.com,1999:blog-14297147.post-17324318091772635092011-08-03T14:58:00.006+05:302011-08-03T17:07:32.081+05:30iOmega Screenplay Director<div style="text-align: justify;">I am a moviebuff and used to watch lot of English, Tamil, Korean, Japanese movies. I felt a media player connected to TV in my living room would be better compared to watching movies in laptop. So, here is my review of the latest gadget in my home. iOmega Screenplay Director. My first choice of media player was WD Live TV because of its low cost (it doesn't come with internal HDD) and I convinced myself to go for Screenplay Director, as one of my colleagues own it. Also, this is the only media player available in Chennai stores. It comes with two years warranty.</div><div style="text-align: center;"><br /></div><div><br /></div><div><img src="http://www.wegotserved.com/wp-content/uploads/2009/11/director_bn.jpg" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 440px; height: 350px;" border="0" alt="" /><div style="text-align: center;"><br /></div></div>Screenplay Director comes with 1TB and 2TB versions. I gone for 1TB version. I copied my movie collection from my laptop and external HDD that I had. I was happy about the space that I have, which could hold hell a lot of movies.<div><br /></div><div><b>Specification:</b></div><div>HDD : 1 TB / 2 TB</div><div>Video formats supported: MPEG1, MPEG2, MPEG4 (upto 1080p), H.264, XviD, WMV, VC-1</div><div>Audio formats supported: AAC, AC3, FLAC, MP3, Ogg Vorbis, WAV, WMA</div><div>Photo formats supported: BMP, GIF, JPG, PNG, TIFF</div><div>Output ports: Composite (SD), Component, HDMI, Optical audio. </div><div>USB ports: 3</div><div>Ethernet port: 1</div><div><br /></div><div>The pack comes with only Composite cable.</div><div><br /><div><b>Design:</b></div><div>The media player is not a sleek one compared to other media players in market. The remote doesn't look impressive and most of the keys have dual purpose. For example, the rew / fwd, vol up / vol dwn keys have a single key and these keys are very small to press what you want to. There are Video, Music and Photo keys in the remote that lets you directly jump instead of pressing the Home key and selecting videos or music or photos.</div><div><br /></div><div><img src="http://ld2.ciol.com/images/Iomega%20Screenplay%20Director%20HD%20(big).jpg" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 640px; height: 690px;" border="0" alt="" /><b>Poor software:</b></div><div>The software is the worst part of the gadget. There are so many bugs, which leads you to restart the device most of the time to recover. The boot up time also takes around 2.30 minutes :(</div><div><br /></div><div><b>User interface:</b></div></div><div>The UI design is okay. Not worst, not the best. There is no customization possible like changing the color of the screen.</div><div><br /></div><div><b>Navigation:</b></div><div>The navigation is designed badly. While watching a movie, if you decide to play another movie, you press the Video key in remote. This takes you to the list of available HDD (internal and external) menu, instead of taking you to the last selected movie folder. I felt this is quite annoying at times. You have to keep scrolling all the times.</div><div><br /></div><div><b>Video:</b></div><div>I haven't used any other media player, but the quality of video that I get in Composite (SD) is quite fascinating. The clarity of the video is really very good. However, some of my downloaded Tamil movies doesn't play with this media player. Not sure why is it. Haven't explored on this. There is no way to customize the subtitles, either the location or the size of the font on the screen. The text is small to read. The player doesn't upscale the audio that comes in the video. Sometimes, the audio is too low that I have to keep 100% volume in my TV.</div><div><br /></div><div><b>Photo:</b></div><div>They haven't cared much to provide a good photo viewing experience. The wide screen photos are just scaled in composite output, which doesn't appeal at all. There is no way to configure the speed for transition. </div><div><br /></div><div><b>Youtube:</b></div><div>The media player doesn't have inbuild wifi capability. However, you could plug in a iOmega wifi dongle in the USB port and connect to internet. I haven't bought one dongle yet. The software supports only YouTube videos from internet.</div><div><br /></div><div><b>Torrent support:</b></div><div>I think these guys thought about all the moviebuffs in the world, who mostly use torrents to download illegal movies. This player allows you to download any files over torrents if you have added it.</div><div><br /></div><div>I wouldn't recommend this media player, except for its good quality video. Most of the LED TVs nowadays come with USB source, where you could plug in an external HDD and play any type of video format. If you are planning to buy such a TV shortly, don't think of going for a media player. </div>Alexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.com0tag:blogger.com,1999:blog-14297147.post-56603721202508991732010-08-03T17:17:00.003+05:302010-08-03T17:35:52.455+05:30miniDLNA (Ubuntu) with Samsung Galaxy SI have been trying to play media files from my laptop running Ubuntu 10.04 through MediaTomb server from Samsung Galaxy S mobile. The mobile was able to read the CDS shared by the server. However, it was not able to playback the video from the server (I kept getting Sorry, the file could not be played). I started the server in debug mode (-D option) and found that galaxy was trying to request the file by sending the complete web server address., i.e., http://<ip_address>:<port>/content/media/file/... . While other DLNA devices request the URL relative to the root folder in the server., i.e., /content/media/...<div><br /></div><div>Even resolving the above issue by fixing the MediaTomb didn't help out. Still galaxy did not get the content for playback (a different issue than the above one). I happened to know that MediaTomb is not 100% DLNA compliant. Tried out miniDLNA and it worked out. miniDLNA seems to be a simple tool that will satisfy your media server needs. miniDLNA is available at <a href="https://sourceforge.net/projects/minidlna/">https://sourceforge.net/projects/minidlna/</a></div><div><br /></div>Alexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.com2tag:blogger.com,1999:blog-14297147.post-80904504655999021622010-05-08T07:52:00.002+05:302010-05-08T08:01:19.102+05:30Youtube 3D<p class="MsoNormal">Youtube player supports Stereoscopy (3D) content. The player provides various options to deliver 3D content differently to your browser. There is an option “Cross-eyed” to watch 3D (with 3D) with your naked eye. But, you should strain your eyes to overlap two images. (I tried and couldn’t make it <span style="font-family:Wingdings;">L</span>). Other options should allow you to watch the video using the 3D special glasses. Currently, youtube doesn’t support Polarized 3D glasses.</p> <p class="MsoNormal">Watch this video. <a href="http://www.youtube.com/watch?v=6RFuRY7azgA" target="_blank">http://www.youtube.com/watch?<wbr>v=6RFuRY7azgA</a>. Notice the “3D” option in the player. Seems there are many 3D content available in youtube. Next thing, I am gonna do is buy a 3D glass <span style="font-family:Wingdings;">J</span>. No wonder if full 3D movies make into youtube in near future.</p> <p class="MsoNormal" style="margin-left: 0.5in;">Copying text from the video:<br />>> </p> <p class="MsoNormal" style="margin-left: 0.5in;">HOW DID I MAKE THIS?<br />I simply used 2 identical (very cheap) cameras and placed them in the same general direction (both level with the lenses separated about 2 1/2 inches from each other). Then I resized the videos in editing and placed them next to each other (like you see in the "cross-eyed" setting). Once it was uploaded I added a few tags to trigger YouTube's new 3D viewing feature. The tag "yt3d:enable=true yt3d:aspect=3.55:4" is a custom tag I made specifically for this video and may not work for your video if you use it but it wouldn't hurt to try I guess. So just put that code into your tags if your video looks like mine.<br /><br />HOW TO ANIMATE IN 3D:<br />Unfortunately, I had to cross my eyes to edit in 3D. I don't have any big fancy programs or a team to animate for me like most 3D studios have. So I like to keep it simple. It was a pain in the arse making this but it worked and I'm happy for that.<br /><br />Camera used:<br />2 Flipcams</p> <p class="MsoNormal" style="margin-left: 0.5in;"><< </p> <p class="MsoNormal"> </p> <p class="MsoNormal"><a href="http://googlesystem.blogspot.com/2009/07/youtube-3d.html" target="_blank">http://googlesystem.blogspot.<wbr>com/2009/07/youtube-3d.html</a></p>Alexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.com0tag:blogger.com,1999:blog-14297147.post-12468077046654429452010-04-24T22:19:00.003+05:302010-04-24T22:27:02.484+05:30Android on iPhoneIts really cool!!!<br /><br />Android running on an iPhone. A member of iPhone development team called Planetbeing have ported Android to run on iPhone. iPhone can be configured to dual boot iPhone OS and Android phone. I even had a glimpse of Android running on iPhone in one of my friend's mobile. I would rate the experience is quiet better than the <a href="http://lexos.blogspot.com/2010/04/samsung-i5700-galaxy-spica.html">Samsung I5700 galaxy spica</a> The graphics transition is quiet faster.<br /><br />The port is currently available only in the first generation iPhones. Hope it would soon be available in iPhone 3G and 3GS models. The source code is available online <a href="http://github.com/planetbeing/iphonelinux">here</a><br /><br />Have a glimpse on this video.<br /><br /><div style="text-align: center;"><object height="350" width="400"><param name="movie" value="http://www.youtube.com/v/5yO2KQHkt4A&color1=0xb1b1b1&color2=0xcfcfcf&hl=en_US&feature=player_embedded&fs=1"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><embed src="http://www.youtube.com/v/5yO2KQHkt4A&color1=0xb1b1b1&color2=0xcfcfcf&hl=en_US&feature=player_embedded&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" height="350" width="400"></embed></object><br /></div>Alexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.com0tag:blogger.com,1999:blog-14297147.post-71189131426475211372010-04-21T23:30:00.004+05:302010-04-21T23:45:49.280+05:30HJSplit for LinuxIf you are looking for an alternative method to join the splited files using HJSplit program, there is one for Linux users. The tool is used to split and join a big file. The splited files are named in the format file_name.avi.001, file_name.avi.002 and so on by the tool.<br /><br />Linux users, just use the 'cat' command to merge the files. The syntax that I used is as below:<br /><br /> $ cat file_name.avi.* > filename.avi<br /><br />This works because the cat command takes filenames in alphabetical order and merges the files.<br /><br />- Have fun.Alexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.com0tag:blogger.com,1999:blog-14297147.post-22924242001190931812010-04-17T11:23:00.003+05:302010-04-17T12:39:11.116+05:30MeeGo 1.0 first look<div style="text-align: justify;">Intel's Moblin and Nokia's Maemo merged together to give birth to MeeGo mobile operating system. MeeGo is a Linux-based operating system with Qt support for UI. The OS currently support ARM and x86 architectures. As the OS has been released as open source (hosted by Linux Foundation), soon there will be support for various architectures. It is claimed that MeeGo is not based on any other Linux distros. But, the packages will use the existing Fedora's .rpm.<br /><br />MeeGo can be downloaded <a href="http://meego.com/downloads">here</a> and developer resources are available <a href="http://meego.com/developers">here</a>.<br /><br />Look at the first preview of MeeGo running in Netbook.<br /></div><br /><div style="text-align: center;"><object width="400" align="center" height="350"><param name="movie" value="http://www.youtube.com/v/_ZlY5oN2qC4&color1=0xb1b1b1&color2=0xcfcfcf&hl=en_US&feature=player_embedded&fs=1"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><embed src="http://www.youtube.com/v/_ZlY5oN2qC4&color1=0xb1b1b1&color2=0xcfcfcf&hl=en_US&feature=player_embedded&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="350"></embed></object><br /></div>Alexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.com1tag:blogger.com,1999:blog-14297147.post-10868539096893713282010-04-11T18:05:00.003+05:302010-04-11T18:24:43.423+05:30Samsung I5700 galaxy spica<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirTTrVJ6eVI-Cv7oOXdzjd4ez4BfoxUpGuS5SrNVl89g6ir919F3Eue8rJVe6_p5rOKmUu5irLhqMgY5sJCakv0jsovfgP2PgJHrLPfXYluEUUK6BDQzLS1Oc4vQg11NZWIQmdEw/s1600/7324c_Samsung-Galaxy-Spica-Galaxy-I5700-Android-Smartphone.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 278px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirTTrVJ6eVI-Cv7oOXdzjd4ez4BfoxUpGuS5SrNVl89g6ir919F3Eue8rJVe6_p5rOKmUu5irLhqMgY5sJCakv0jsovfgP2PgJHrLPfXYluEUUK6BDQzLS1Oc4vQg11NZWIQmdEw/s320/7324c_Samsung-Galaxy-Spica-Galaxy-I5700-Android-Smartphone.jpg" alt="" id="BLOGGER_PHOTO_ID_5458860980713711746" border="0" /></a>If you are looking for a cheaper and good Android based mobile, consider Samsung I5700 galaxy spica. Initial looks and feature of this phone looks promising. In fact, the main reason that I am considering this model is it comes with Qualcomm 800MHz processor, comparing to 200MHz processor in my current mobile. Listed below are the basic features of this model:<br /><ul><li>800 MHz Qualcomm processor.</li><li>Android v1.5, you can upgrade to v2.1.</li><li>16M color, compared to 256k color in my current mobile.</li><li>3.5 mm audio jack. SE users will understand why this is a required feature :)</li><li>3.2" TFT capacitive touch screen display.</li><li>wi-fi, gps</li><li>The most appealing thing is you get a xVid/divX player application.</li></ul>The big brother of this model is Samsung I7500 galaxy spica, which came with a slower processor. You will feel the difference with 800MHz processor speed.<br /><br />With Android, you have a open box. You can write and use your own applications. Current market price is around Rs.12,000. No wonder, if I buy this as my other mobile soon :)Alexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.com0tag:blogger.com,1999:blog-14297147.post-58771677082592876042009-11-06T19:53:00.003+05:302009-11-06T20:56:39.251+05:30Ubuntu 9.10Ubuntu 9.10 seems to be a worst product from Canonical. 9.10 was on a high expectation. The next release after 9.10 is going to be a Long Term Support product by Canonical Ltd. The other reason is the new Windows 7 from MS received many good responses around the world.<br /><br />Most of the users upgraded / freshly installed 9.10 are hit by black screen issues. Some of the devices which worked in 9.04 discontinued to work in 9.10. It is always better to wait for any new product to arrive in the market, wait until it is reviewed by its users and then decide on buying it. The same applies for software too. I was saved by this simple idea by not installing 9.10 on the day of its release :). It is always good to be not biased.<br /><br />According to a <a href="http://ubuntuforums.org/showthread.php?t=1305924">survey</a> in Ubuntu Forums, around 33% (at the time of writing this) of the Ubuntu users seem to be affected by irrecoverable problems. May be, it is the karma of Ubuntu.<br /><br />Canonical should have been more responsible. They had a very good market share in distribution based on GNU/Linux. They brought down the complex usability of GNU/Linux distribution to a much easier and simpler usability for end users. That was their success.<br /><br />On the other side, Windows 7 seems to be a default version for many Windows users next to Windows XP. It seems to be a stable version too. Ubuntu 9.10's failure should have been considered as a success for some Windows 7 royal fans. They think Ubuntu is Linux.Alexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.com0tag:blogger.com,1999:blog-14297147.post-30112460578964565172009-09-02T14:35:00.005+05:302009-09-02T18:03:12.366+05:30Software Freedom Day 2009Software Freedom Day is being celebrated across the world to promote Free and Open Source Software (FOSS) and celebrate the people behind FOSS. A non-profit company based in USA called Software Freedom International (SFI) coordinates the SFD across the globe. Though, there are many local groups in different regions that celebrates the day by themselves.<br /><br />I am not totally involved in any of the Open Source projects. But, I could understand the freedom given to the end user in any software that they use. One have full freedom to customize the software for their use and enhance it. I was using pirated editions of Windows in my college days. Now, I have migrated to the FOSS world. I use Ubuntu in my personal laptop. Whatever software that I want to do my day to day activities are also freely available for Linux. This prevents me from stealing others work ;) I am not against M$ or anything. I just prefer to be with FOSS.<br /><br />The SFD is also celebrated in Chennai. The date is 19 September 2009. The venue planned is Birla Auditorium, Kotturpuram. There are various events, stalls, activities being planned for the day. Lots of people are volunteering themselves to contribute to the event, which is a nice thing.<br /><br />To learn more about FOSS, visit <a href="http://en.wikibooks.org/wiki/FLOSS_Concept_Booklet">http://en.wikibooks.org/wiki/FLOSS_Concept_Booklet</a><br /><br />I personally feel, though one likes FOSS, they should not be biased to FOSS and grow hatred towards non-FOSS people.<br /><br />So, have fun. Let the source be with you...Alexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.com0tag:blogger.com,1999:blog-14297147.post-54897196171743467722008-02-21T11:44:00.003+05:302008-02-21T12:52:42.366+05:30My Lego Mindstorms Nxt kit<div style="text-align: center;"><br /></div><span style=";font-family:georgia;font-size:100%;" >Hurrayyyyy!!!!!!!!!!!<br /><br />After a long research and lonnnngggg search, finally I got my Lego Mindstorms Nxt (LMN) robotics kit, last weekend. It was a long wait and I was frustrated by Walmart, Fry's Electronics guys. I picked up mine at a Lego retail store in Hillsdale mall. It costed me $260. Costly though. I am not sure, if you could get one in India.<br /><br /></span><div style="text-align: center;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4AiEZR6RznUIHy-qMkxHOZvQjLr1LqgCJYu-zkMC4lkEigu7uiuUrJG7QWc93G3780EbgBp3i_lRjT42WxKHI9LS-9Mpx7aLQenaF59imwuABvDFsVwV1VpRDAInTWRX3Fhwscg/s1600-h/Picture+007.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4AiEZR6RznUIHy-qMkxHOZvQjLr1LqgCJYu-zkMC4lkEigu7uiuUrJG7QWc93G3780EbgBp3i_lRjT42WxKHI9LS-9Mpx7aLQenaF59imwuABvDFsVwV1VpRDAInTWRX3Fhwscg/s320/Picture+007.jpg" alt="" id="BLOGGER_PHOTO_ID_5169330393068430530" border="0" /></a></div><span style=";font-family:georgia;font-size:100%;" ><br />I was evaluating a robotics kit for a long time, as I don't know much of mechanical or electronics to </span><span style=";font-family:georgia;font-size:100%;" >design bots or </span><span style=";font-family:georgia;font-size:100%;" >construct circuit boards. My research took me to Lego Mindstorms Nxt kit, which is actually meant for 10+ years kids. But, it's okay. There are lot of guys out there working on their innovative ideas on the kit. Those ideas are fascinating.<br /><br />Let's look at the stuffs that come with the package. The earlier edition of LMN was just called "Lego Mindstorms" and it is in retail no more.<br /></span><ul><li><span style=";font-family:georgia;font-size:100%;" >The brain of this kit is the NXT brick, which runs 32-bit ARM7 micro-controller. More details later.</span></li><li><span style=";font-family:georgia;font-size:100%;" >Three servo motors - for movements, arms or wheels.</span></li><li><span style=";font-family:georgia;font-size:100%;" >Ultrasonic sensor - to measure distance to an object.</span></li><li><span style=";font-family:georgia;font-size:100%;" >Light sensor - to detect light and color.</span></li><li><span style=";font-family:georgia;font-size:100%;" >Sound sensor - to hear sound</span></li><li><span style=";font-family:georgia;font-size:100%;" >Touch sensor - to feel the environment<br /></span></li><li><span style=";font-family:georgia;font-size:100%;" >577 lego bricks, screws, etc etc for constructing robots.</span></li></ul>The NXT brick has three output ports for motors and four input ports for sensors. The configuration for the NXT brick is as below:<br /><span id="ContentAdminRepeater1__ctl0__ctl0_Text"><ul><li>32-bit ARM7 microcontroller </li><li>256 Kbytes FLASH, 64 Kbytes RAM </li><li>8-bit AVR microcontroller </li><li>4 Kbytes FLASH, 512 Byte RAM </li><li>Bluetooth wireless communication (Bluetooth Class II V2.0 compliant) </li><li>USB full speed port (12 Mbit/s) </li><li>4 input ports, 6-wire cable digital platform (One port includes a IEC 61158 Type 4/EN 50 170 compliant expansion port for future use) </li><li>3 output ports, 6-wire cable digital platform </li><li>100 x 64 pixel LCD graphical display </li><li>Loudspeaker - 8 kHz sound quality. Sound channel with 8-bit resolution and 2-16 KHz sample rate. </li><li>Power source: 6 AA batteries </li></ul></span>Now, let us look at the programming environment that comes with the kit. Since the kit was designed for 10+ age group, Lego decided to go with a GUI based programming. The language is called NXT-G. It has a collection of what is called blocks and a number of required blocks are connected together to accomplish a task.<br /><br />But, it does not stop here. If you are looking for a programming environment similar to C, you are not the first one to think about it. There are pretty good number of development environments/languages that closely resembles ANSI C standards. The widely used OS for NXT kit is LEJOS, a tiny Java VM.<br /><br />Though I am ready to start my work on this, I am waiting for my current assignments (job) to come to a stop. So that, I would get more time to work on this.<br /><br />NXT blog: About various languages available for NXT kit.<br /><br />Pictures are available at http://picasaweb.google.com/alexander.hclt/MyLegoMindstormsNxtKit<br /><br />Have fun!!!Alexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.com2tag:blogger.com,1999:blog-14297147.post-22991741440426329482007-12-26T15:45:00.000+05:302007-12-26T16:18:56.846+05:30Configuring ALSA driver in Lenovo 3000N100<span style="font-family: trebuchet ms;font-size:100%;" >Guys, It has been a while since I configured audio driver in Linux OS for my Lenovo 3000N100 laptop and made it working. Thanks to guys working in Linux world. They are open-minded and ready to help you out in any trouble.<br /><br />Here are the steps:<br />1. Download the ALSA driver package from an FTP site (Google it!!!) and untar it in your home directory.<br /><br />2. If you really need to configure ALSA for your 3000N100, mail me. I will send you a patch file.<br /><br />3. Untar the patch file "</span><span style="font-family: trebuchet ms;font-size:100%;" >patch_realtek.c" and replace the same file in the folder "</span><span style="font-family: trebuchet ms;font-size:100%;" >alsa-driver-xxx/alsa-kernel<wbr>/pci/hda/"<br /><br />4. cd to "alsa-driver-xxx" folder.<br /><br />5. Issue ./configure --with-cards-hda-intel</span><span style="font-family: trebuchet ms;font-size:100%;" > <p> make</p> <p> make install</p>Congrats!!! Your laptop is now ready to ROCK in Linux!!!<br /><br />- Alexander<br /></span>Alexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.com0tag:blogger.com,1999:blog-14297147.post-5309112261579112112007-07-13T20:26:00.000+05:302007-07-13T21:05:46.549+05:30Lenovo 3000 N100<span style="font-family:verdana;">I was planning to buy a laptop for quite a long time. After comparing various brands and models, I decided to go for Lenovo 3000 N100 series laptop. I was also looking for a model that would have full support in Linux.</span><br /><span style="font-family:verdana;"></span><br /><span style="font-family:verdana;">I was struck on choosing a good processor. Intel dual-core architecture is based on Intel Pentium M processor. Intel Core 2 Duo is advanced than Intel dual-core processor, in a way that the former supports IA64. Also, it is designed to consume less power than IDC processor. </span><br /><span style="font-family:Verdana;"></span><br /><span style="font-family:Verdana;">Dell laptops come with good configuration for a less price. But, you have to wait for atleast 15 days, until you get your laptop. Also if you are planning to install Linux, Dell is a good choice as Linux have driver support for almost all components.</span><br /><span style="font-family:Verdana;"></span><br /><span style="font-family:Verdana;">Lenovo 3000 N100 comes pre-installed with Windows Vista. Windows XP is not written for Multi-processor. So, installing Windows XP is a bad idea in a dual-core laptop. I got my laptop in a week after placing my order. </span><br /><span style="font-family:Verdana;"></span><br /><span style="font-family:Verdana;">Partitioning was quite easy in Vista. The model comes with 105 GB of single primary partition. 6 GB is dedicated to windows recovery partition. I used diskpart.exe (a command-line utility that comes with Vista) to shrink the primary partition. I could only shrink the partition for a maximum of 32 GB. And created another primary partition. Though it's not bad, as Linux could just mount Vista partition.</span><br /><span style="font-family:Verdana;"></span><br /><span style="font-family:Verdana;">Earlier, I got my Ubuntu AMD64-bit edition from <a href="http://www.ubuntu.com/getubuntu">http://www.ubuntu.com/getubuntu</a> Just booted the CD. Ubuntu desktop welcomed me with 'Install' icon. You have to just cross 7 easy steps for easy installation. </span><br /><span style="font-family:Verdana;"></span><br /><span style="font-family:Verdana;">But unfortunately, audio doesn't work with this model in Linux. In Vista, it works. But, the sound is too low. You have to use a headphone to listen music or to watch movies. Hope the tutorials in ubuntuforums will help me.</span><br /><span style="font-family:Verdana;"></span><br /><span style="font-family:Verdana;">Alexander.</span>Alexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.com0tag:blogger.com,1999:blog-14297147.post-30065916102527567712007-07-10T16:43:00.000+05:302007-07-10T16:49:26.568+05:30Inside Apple iPhone<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcyUr8SFvAJEDyqOuK2w24MZNs_WAnQr1GkflMlOZixTxzIpae7gTbb0QXLnkgVIrDNuia26rhXKt4vUpRViYiYo-crya1oj5Zgyr7V89MHfcby-qd8sHUY9TTxoPr0kacb2KGRQ/s1600-h/iPhone1_High.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcyUr8SFvAJEDyqOuK2w24MZNs_WAnQr1GkflMlOZixTxzIpae7gTbb0QXLnkgVIrDNuia26rhXKt4vUpRViYiYo-crya1oj5Zgyr7V89MHfcby-qd8sHUY9TTxoPr0kacb2KGRQ/s320/iPhone1_High.jpg" alt="" id="BLOGGER_PHOTO_ID_5085525438020914738" border="0" /></a><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2DPhacHMOU7mZ9286pHxcBr_8ep5dotRGVbJo0hIqaW1IwIrm732NN0TdzaKpeNodh4QdkskfhxxZ-fhgoLEwAV8dq16DSIG-DAiiBTdpJnABVV_cK69XIya7izxAHAXXjkEdsw/s1600-h/iPhone2_High.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2DPhacHMOU7mZ9286pHxcBr_8ep5dotRGVbJo0hIqaW1IwIrm732NN0TdzaKpeNodh4QdkskfhxxZ-fhgoLEwAV8dq16DSIG-DAiiBTdpJnABVV_cK69XIya7izxAHAXXjkEdsw/s320/iPhone2_High.jpg" alt="" id="BLOGGER_PHOTO_ID_5085525631294443074" border="0" /></a><br /><br /><div style="text-align: center;"><span style="font-style: italic;">[Courtesy: embedded.com]</span><br /></div>Alexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.com0tag:blogger.com,1999:blog-14297147.post-37608247835848308522007-04-24T16:57:00.000+05:302007-04-24T17:05:28.386+05:30SickSackSickSack (Sounds like Zig Zag).<br /><br />Guess what? It's a robot. Yes, follows a black line on the floor like a snake. It has been designed by two innovative guys, <em>Lars Pontoppidan and Aske Olsson in USA.</em><br />Click the link, <a href="http://pontoppidan.info/lars/index.php?proj=sicksack">http://pontoppidan.info/lars/index.php?proj=sicksack</a> for more details about the robot. Don't forget to check out the videos.<br /><br />It has been my dream for quite some time now, to do some work-around in Robotics. Hope it would work out some day.<br /><br />-NOTNULL.Alexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.com0tag:blogger.com,1999:blog-14297147.post-40394517711972898932007-01-05T10:24:00.000+05:302007-01-05T10:45:49.087+05:30The Google StoryRecently, I happened to read the book "The Google Story" by David A. Vise. What to say? It's really a wonderful book, which explains the complete story of Google. It has many interesting information right from Google cook Charlie Ayer, Google stock, Eric Schmidt joining Google, etc. Page by page, it ties the reader to the book.Alexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.com0tag:blogger.com,1999:blog-14297147.post-4878212109116693412007-01-02T14:35:00.000+05:302007-01-02T17:06:47.237+05:30Recovering from lost Windows boot loader<p class="docText"><a name="linuxnut4-CHP-4-ITERM-3118"></a><a name="linuxnut4-CHP-4-ITERM-3119"></a><a name="linuxnut4-CHP-4-ITERM-3120"></a>When you install the boot loader (either LILO or GRUB) on the MBR, it replaces the MS-DOS boot loader or any other boot loader that may be there, such as the Windows NT loader. If you have problems with your installation or you simply want to restore the original boot loader, you can do one of the following.</p> <ul><li> <p class="docList">If you're running LILO, you can boot Linux from a floppy or CD and restore the boot sector, which LILO automatically backs up:</p><pre>% <b>/sbin/lilo -u</b></pre> </li><li> <p class="docList">If you have the capability, boot to DOS and run the <span class="docEmphBold">fdisk</span> command with a special option that rebuilds the MBR:</p><pre>C:> <b>fdisk /mbr</b></pre> </li><li> <p class="docList">For Windows 2000 and Windows XP, which do not have an <span class="docEmphBold">fdisk</span> command, boot your computer from the Windows CD (or the Windows boot floppies if you can't boot from your CD drive). When you see "Welcome to Setup," press R (for repair) and, in Windows 2000, you then press C. Select your Windows installation from the numbered list that is displayed (there may be only one entry) and enter the administrator password at the prompt. Enter the command <span class="docEmphBold">fixmbr</span> at the command-line prompt and confirm it with <span class="docEmphBold">y</span>. After the MBR has been restored, type <span class="docEmphBold">exit</span> to reboot.</p></li></ul>Alexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.com0tag:blogger.com,1999:blog-14297147.post-1151413182249859662006-06-27T18:12:00.000+05:302006-06-27T18:29:42.273+05:30.bss ???What is a BSS segment?<br /><br />Most of the guys ask me this question. This is some segment in your application similar to .text, .data and .stack. All the un-initialized variables go into this section, rather than .data segment. This is to reduce the size of your .exe or .o files.<br /><br />For example, if you have declared a variable "int a", it goes into the .bss segment. The compiler will not allocate space for "a" in the executable file. Instead, it will accumulate such variables and calculate the total number of bytes and add it in the header.<br /><br />So your application will not have the space allocated, when it is in secondary memory. Once it is loaded into the primary memory, the number of bytes for the .bss segment is read from the header and allocated in RAM.<br /><br />- Alexander.Alexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.com0tag:blogger.com,1999:blog-14297147.post-1146221132373370712006-04-28T14:50:00.000+05:302006-04-28T16:17:45.796+05:30Kernel @ 1 MBTill now, secondary loader loads the kernel at 0x9000. Now, the loader will load the kernel at 1MB mark. Also, I have created a linker.ld file to link the kernel at 0x100000. Below is my linker.ld script:<br /><br />ENTRY (_start32)<br /><br />SECTIONS<br />{<br /> .text 0x100000 :<br /> { *(.text) }<br /><br /> .data :<br /> { *(.data) }<br /><br /> .bss :<br /> { *(.bss) }<br />}<br /><ul> <li>I have implemented PMM (Physical Memory Manager) in my kernel, which runs below VMM (Virtual Memory Mapper). Though, it is in its priliminary stage.</li> <li>init_pmm() - Will initialize the stack, which holds the address of free pages. The stack is initialized based on the memory map passed by the LEXOS' secondary bootloader. PMM will ignore any usable memory below 1 MB, as it is reserved for V86 mode.</li> <li>alloc_page() - Will pop a free page from the stack and return it to the calling thread. The PMM returns the physical address of the free page. This address will be mapped by the VMM to the process' virtual address space.<br /> </li> <li>free_page() - Will push the page to be freed into the stack.<br /> </li> </ul>Alexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.com0tag:blogger.com,1999:blog-14297147.post-1134643431542722992005-12-15T16:04:00.000+05:302006-04-20T16:46:34.350+05:30LEXOS' MMLexos will use buddy system algorithm for page allocator. I am still learning buddy allocator, since, I don't find much free time nowadays. Flaws in memory management algorithms will make an operating system weaker. So, I am taking much time to learn and design buddy allocator in my OS.<br />Lexos will have VMM on top of PMM. PMM (Physical Memory Manager) will service the applications and kernel by providing and freeing page frames on demand. The allocated pages will be mapped into virtual address by VMM (Virtual Memory Mapper).<br /><br />Edit: As for the time being, I have planned to use stack based approach to manage physical page frames. Later, I would use buddy allocator. Though, I am thinking of using a modified version of stack-based approach, which would have individual stack that holds free pages in the order of 2^n.Alexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.com0tag:blogger.com,1999:blog-14297147.post-1129812944394731782005-10-20T18:25:00.000+05:302005-10-20T18:51:26.926+05:30Detecting physical memoryHi all,<br /> Now, I have come up to explain how to determine the physical memory in the system. You should detect the physical memory map and pass this info to the kernel, which will be used by the physical memory manager. BIOS interrupt 15h, functions E820h, E801h and 88h are there to help you out in this. You should try using these functions in the order mentioned, if one of the function failed. It would be better, if your bootloader supports all these functions. If you use GRUB, instead of your own bootloader, the multiboot structure will be passed to your kernel, which will hold the memory map.<br /> Memory map is a table that holds the information about your physical memory. Each entry in the table holds base address (8 bytes), length (8 bytes) and the type of the memory (8 bytes). You can look into more details about all these BIOS interrupts at <a href="http://www.uruk.org/orig-grub/mem64mb.html">http://www.uruk.org/orig-grub/mem64mb.html</a><br /> When you enable paging in your kernel, READ_ONLY permission can be given to the memory blocks, which are not available for Operating System use.Alexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.com0tag:blogger.com,1999:blog-14297147.post-1129053005219259672005-10-11T23:20:00.000+05:302005-10-11T23:20:05.246+05:30Memory ManagementHi,
<br /> My keyboard driver is complete now and I have started learning about Memory Management. Normally, any 32-bit protected mode operating systems will have atleast two memory managers. One running in the lower level that allocates the actual physical memory and the next that works in the virtual memory layer that interacts with the physical memory manager to actually allocate physical memory. An operating system should efficiently manage memory. There are various techniques available to manage memory efficiently, stack-based approach, bitmap approach and linux's buddy system algorithm. You are not restricted to used only these algorithms. You can very well implement your own idea or the combination of any of those mentioned. Now, let us see the stack-based approach and the bitmap approach to manage the memory. I will let you all know the buddy system algorithm sooner or later :).
<br />
<br />* Stack-based approach:
<br /> In the stack-based approach, the starting address of the physical pages are pushed into the stack initially. Then, when one or more pages are requested, they will be popped out from the stack as appropriate and the address will be passed to the virtuall mm. The advantage of using stack-based approach is that the speed of alloting pages. But, the main downfall of the stack-based approach is the fragmentation. Fragmentation arises when the free pages in the memory are not contiguous. Although you can run a daemon to reduce fragmentation when the system is free and the memory is considered to be more fragmented. Also, the space this approach takes for storing the free page addresses is also huge. Because, the size of a pointer in a 32-bit environment will be 32 bits. So, to keep track of 128 MB of memory (32768 pages), you need 128 KB of memory. You need not allocate memory pages to maintain these free page information.
<br /> You are going to return the actual physical memory to the virtual memory manager. How will the DMA controller manage when you send the physical address > 16 MB? Because, the DMA controller is not going to convert the address into physical address. Rather, it will just send the address through its address line. Well, now, you need to maintain two different stacks, one that will contain page addresses < 16 MB (for DMA) and the other will contain page addresses > 16 MB. Freeing page is as easy as allocating page. Just push the address of the page into the stack, which will used by the physical memory manager.
<br />
<br />* Bitmap approach:
<br /> The bitmap approach is the alternative approach available to you, if you think that the Stack-based approach eats up more memory. Here, you use only one bit to store the status of the free page. 1 for available, 0 for occupied. So, in a single byte, you can store the status of 8 pages, which uses very less amount when compared with the previous stack-based approach. You can also use the bitmap to effectively allocate the best-fit and first-fit approach, which is not possible in the stack based approach. But, you need to start scanning the bitmap from the beginning, which may consume more time to allocate in best-fit approach. Some macros can be written to substitute the status of page by giving the page address.
<br />
<br /> I will explain the buddy system that is used in Linux later. I have not yet decided which algorithm to use in my physical memory manager. Recently, I have read some articles that use binary trees to track the free pages, instead of using linked list.
<br />
<br />-NOTNULLAlexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.com0tag:blogger.com,1999:blog-14297147.post-1126257192320825072005-09-09T14:42:00.000+05:302005-09-09T14:43:12.326+05:30Back againHi all, <br /> Bloggin' you after a long time. :-) I would like to add my current OS status. I have started writing the keyboard driver and it is nearing completion. Finally, I learnt that developing an Operating System on your own needs a plenty of theoritical knowledge. So, I started Learning various documents. I would suggest Intel x86 manuals (if you are coding for the same), GCC manual, NASM manual, Operating Systems theory books (to know the various techniques used for mm, pm, dm, etc). Also, learn the book "Understanding the Linux Kernel" by DANIEL P. BOVET and MARCO CESATI. It explains all sorts of things Linux does, device management, IO Interuppts and exception handling, memory management, virtual memory, etc. It is a must read book for OS developers.<br /><br /> You should also have good design skills. To be able to design a system, you should have a good theoritical knowledge. In order to gain theoritical knowledge, you should rad more books. So, I started reading various operating system books in my free time. I find it quite helpful in designing a system. Recently, I learnt about the system calls. I will explain you about what is a system call, how does it get activated? Are open, creat, read, write actually system calls? Or there exists something below these functions above which these functions act as system calls?<br /><br />-NOTNULLAlexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.com0tag:blogger.com,1999:blog-14297147.post-1120801517581103272005-07-08T11:14:00.000+05:302005-07-08T11:15:17.583+05:30Loading the kernelAfter POST [<a href="http://www.pcguide.com/ref/mbsys/bios/bootPOST-c.html">http://www.pcguide.com/ref/mbsys/bios/bootPOST-c.html</a>], the BIOS looks at the first sector of the primary boot device. If boot code is written in the first sector, it is loaded into the memory at address 0x7C00 by the BIOS and the system jumps to that code. Now, how does the BIOS identify the boot loader code? Since, this boot code is the first to get loaded into memory, we call it as Primary Bootloader, which can only be a maximum of 512 bytes. The last 2 bytes of a boot loader has, 0xAA55. This is the standard signature for any primary boot loader. Since, the primary loader needs to be less than 512 bytes, it should be written in x86 assembly language.<br /><br /> The primary loader loads either secondary bootloader or kernel into memory. The choice is left to you. The secondary loader does not have the constraint of being less than 512 bytes. It can be of any size and it can be written in a high-level language, such as C, C++, etc. The primary job of a secondary loader needs to set up the environment for kernel, i.e., GDT, IDT, etc, load the kernel and jump to it.<br /><br />-NOTNULLAlexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.com0tag:blogger.com,1999:blog-14297147.post-1120801412606235122005-07-08T11:10:00.000+05:302005-07-08T11:13:32.610+05:30Types of kernel<p><br />Since, I am running out of time today, I will explain you the types of kernel shortly. Basically, there are three types of kernel:</p><ul><li>Monolithic Kernel </li><li>Micro Kernel </li><li>ExoKernel</li></ul><p><strong>Monolithic:<br /></strong>As the name itself suggests, the kernel has every services like, FS Management, MM, Process Management, etc. in the kernel space. It does not run as a seperate process. So, as you guess, there is no context switching, when you ask for a service. But, the probability of a monolithic kernel getting struck is more. Because, if there is a bug in the kernel itself, nothing can rescue it. Linux and Windows are good examples of Monolithic kernel. Linux, being a monolithic kernel, you can insert modules into the kernel dynamically using insmod command.</p><p><strong>Micro Kernel:<br /></strong>Micro kernel runs all the services as a daemon in the user space. So, if a problem occurs in any of the service, the kernel will be able to decide what to do next. But, you pay-off the time to switch to a service in this type of kernel. Micro kernels are some what difficult to design and build than the monolithic kernel. There are always a discussion over the internet, talking about the advantage and disadvantages of monolithic and micro kernel.</p><p><br /><strong>Exo Kernel:<br /></strong>Exo kernel is not yet stabilized. It's under design and research. The user mode processes running in this type of kernel has the ability to access kernel resources like process tables, etc directly.<br /></p>Alexanderhttp://www.blogger.com/profile/06175638859698823858noreply@blogger.com3