Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Under src/kernel/klib386.s about FLAT_DS_SELECTOR

4 views
Skip to first unread message

guokun

unread,
Apr 6, 2003, 1:03:13 AM4/6/03
to
Under port_write_byte call
line 436: mov ecx, FLAT_DS_SELECTOR
line 437: mov ds, cx

Under phys_copy
line 563: mov eax, FLAT_DS_SELECTOR
line 564: mov es, ax

I don't know What function about FLAT_DS_SELECTOR represents.
Why FLAT_DS_SELECTOR can move to es and also ds?
I think flat memory map make no difference about es and ds,
because es=ds. Is that right?

Thanks for you help.

--
guokun Northwestern Polytechnical University ,China.


Kees J Bot

unread,
Apr 7, 2003, 5:39:17 AM4/7/03
to
In article <b6ofs9$3eu$1...@mail.cn99.com>, guokun <guo...@hotmail.com> wrote:
>Under port_write_byte call
>line 436: mov ecx, FLAT_DS_SELECTOR
>line 437: mov ds, cx
>
>Under phys_copy
>line 563: mov eax, FLAT_DS_SELECTOR
>line 564: mov es, ax
>
>I don't know What function about FLAT_DS_SELECTOR represents.

The descriptor for that selector addresses all memory from address zero
up.

>Why FLAT_DS_SELECTOR can move to es and also ds?
>I think flat memory map make no difference about es and ds,
>because es=ds. Is that right?

The string instructions read from DS:ESI and/or write to ES:EDI. You
can use a segment override to change DS into another segment register,
which is done for phys_copy, ESEG MOVS moves words from ES:ESI to
ES:EDI.

(Just to be complete: The 8086 has a bug that makes it forget about the
segment override if the REP xSEG MOVS is interrupted.)
--
Kees J. Bot, Systems Programmer, Sciences dept., Vrije Universiteit Amsterdam

guokun

unread,
Apr 7, 2003, 11:11:11 PM4/7/03
to
Kees J Bot,Thank you.


---
guokun


guokun

unread,
Apr 8, 2003, 6:56:27 AM4/8/03
to

Thank you,Bot.

--
guokun,Northwestern Polytechnical University ,China


0 new messages