linux启动过程:用网络卡从并口上启动Linux来源: 发布时间:星期二, 2009年5月5日 浏览:0次 评论:0
="t18">
作者:raoxianhong 代码: 1、到底想干什么 了解Linux ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 也可以在某些专用产品中使用(比如专用 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 2、Linux对启动 ![]() ![]() Linux(bzImage Kernel)对启动 ![]() ![]() ![]() ![]() ![]() ![]() 给出 ![]() ![]() 绝对地址0x100000(1M地址处) ![]() ![]() initrd小于4M ![]() ![]() ![]() ![]() ![]() 然后执行 ![]() ![]() ![]() ![]() 当然 ![]() ![]() ![]() 3、PC机开机流程--启动 ![]() PC机加电后 ![]() ![]() ![]() ![]() ![]() ![]() ![]() 全部 ![]() ![]() ![]() ![]() ![]() 了解这个过程 ![]() ![]() 1)放在启动设备 ![]() ![]() ![]() ![]() ![]() ![]() ![]() 2)放在总线扩展设备 ![]() ![]() ![]() ![]() ![]() ![]() ![]() 3)哪位高手能够修改ROMBIOS ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 4)先启动 ![]() ![]() ![]() ![]() 提供了 ![]() ![]() ![]() ![]() 4、操作系统放在何处 操作系统( ![]() ![]() ![]() ![]() ![]() ![]() 可以从软盘、硬盘、CDROM、网络、磁带机、并口(软件Software狗上烧个内核和应用 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 反正 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 好了 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 5、将数据移动到绝对地址处 第 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 在 ![]() ![]() ![]() ![]() ![]() ![]() 流程是: ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 存放处bx=0,es低 4为位为零表示es:bx在64K边界上 ![]() ![]() ![]() ![]() 也以64K字节为单位 ![]() ![]() { 将es右移 4位 ![]() ![]() ![]() ![]() ![]() 描述符中24位地址 ![]() ![]() ![]() 将fs ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 将es存放在move_es中 ![]() ![]() ![]() ![]() ![]() ax清零返回 ![]() } ![]() { ![]() ![]() ![]() ![]() ![]() { ![]() ![]() ![]() ![]() ![]() 目 ![]() ![]() ![]() ax = 1 ![]() } ![]() { ax = 0; ![]() } } # we will move %cx ![]() ![]() # when we first call movetohigh(%cs:move_es is zero), # the es:bx and %edx is valid # we configure the param first # follow calls will move data actually # %ax ![]() ![]() ![]() ![]() # really to be moved # movetohigh: cmpw $0, %cs:move_es jnz move_second # at this po ![]() # %edx is the destination address movb $0x20, %cs:type_of_loader movw %es, %ax shrw $4, %ax movb %ah, %cs:move_src_base+2 movw %fs, %ax movb %al, %cs:move_dst_base+2 movw %es, %ax movw %ax, %cs:move_es xorw %ax, %ax ret # nothing ![]() move_second: xorw %ax, %ax testw %bx, %bx jne move_ex pushw %ds pushw %cx pushw %si pushw %bx movw $0x8000, %cx # full 64K, INT15 moves Words pushw %cs popw %es leaw %cs:move_gdt, %si movw $0x8700, %ax ![]() jc move_panic # this, ![]() movw %cs:move_es, %es # we re ![]() ![]() incb %cs:move_dst_base+2 # to 0x10000 popw %bx popw %si popw %cx popw %ds movw $1, %ax move_ex: ret move_gdt: .word 0, 0, 0, 0 .word 0, 0, 0, 0 move_src: .word 0xffff move_src_base: . ![]() . ![]() ![]() .word 0 # limit16,base24 =0 move_dst: .word 0xffff move_dst_base: . ![]() . ![]() ![]() .word 0 # limit16,base24 =0 .word 0, 0, 0, 0 # BIOS CS .word 0, 0, 0, 0 # BIOS DS move_es: .word 0 move_panic: pushw %cs popw %ds cld leaw move_panic_mess, %si call prtstr move_panic_loop: jmp move_panic_loop move_panic_mess: . ![]() 6、用并口传输数据 用并口传输数据 ![]() ![]() ![]() ![]() 并口线连接参考该文件 ![]() 字节收发过程如下: # ![]() # ![]() # ![]() ![]() # ![]() # ![]() # ![]() ![]() ![]() { unsigned char c0; unsigned long cx; data_write((data & 0x0f)); data_write((0x10 (data & 0x0f))); cx = 32767l * 1024l; while (1) { c0 = data_read ![]() ![]() ![]() ![]() ![]() ![]() ![]() } data_write(0x10 (data >> 4)); data_write((data >> 4)); cx = 32767l * 1024l; while (1) { c0 = data_read ![]() ![]() ![]() ![]() ![]() ![]() } ![]() } ![]() ![]() { unsigned char c0, c1; unsigned long cx; cx = 32767l * 1024l; while (1) { c0 0
相关文章读者评论发表评论 |
|