gs_fs0文件是什么_linux内核bootsect.s文件中的“ seg fs”是什么...

在阅读早期的Linux内核代码时,我在boot / bootsect.s中遇到了难以理解的问题.“ seg fs”,它在做什么?如果我想更改为AT& T的汇编语法,该怎么办!

go: mov ax,cs

mov dx,#0x4000-12 ! 0x4000 is arbitrary value >= length of

! bootsect + length of setup + room for stack

! 12 is disk parm size

! bde - changed 0xff00 to 0x4000 to use debugger at 0x6400 up (bde). We

! wouldn't have to worry about this if we checked the top of memory. Also

! my BIOS can be configured to put the wini drive tables in high memory

! instead of in the vector table. The old stack might have clobbered the

! drive table.

mov ds,ax

mov es,ax

mov ss,ax ! put stack at INITSEG:0x4000-12.

mov sp,dx

/*

* Many BIOS's default disk parameter tables will not

* recognize multi-sector reads beyond the maximum sector number

* specified in the default diskette parameter tables - this may

* mean 7 sectors in some cases.

*

* Since single sector reads are slow and out of the question,

* we must take care of this by creating new parameter tables

* (for the first disk) in RAM. We will set the maximum sector

* count to 18 - the most we will encounter on an HD 1.44.

*

* High doesn't hurt. Low does.

*

* Segments are as follows: ds=es=ss=cs - INITSEG,

* fs = 0, gs = parameter table segment

*/

push #0

pop fs

mov bx,#0x78 ! fs:bx is parameter table address

seg fs

lgs si,(bx) ! gs:si is source

mov di,dx ! es:di is destination

mov cx,#6 ! copy 12 bytes

cld

rep

seg gs

movsw

mov di,dx

movb 4(di),*18 ! patch sector count

seg fs

mov (bx),di

seg fs

mov 2(bx),es

mov ax,cs

mov fs,ax

mov gs,ax

xor ah,ah ! reset FDC

xor dl,dl

int 0x13

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值