I/O 포트 질문입니다.

hwandori의 이미지

아주 기초적인 질문입니다.

부팅소스를 보면 I/O port를 직접 접근하는 in , out 어셈블리 명령을

쓰는데, memory maped I/O를 이해하지 못해서 그런지 이해가 잘 안되네요.

예를 들어 0x6X가 키보드 컨트롤러의 I/O포트 주소라고 되어있는데,

실제 메모리 0x6X가 키보드 컨트롤러의 I/O 포트에 매핑 되어있는것인가요?

xorw %ax , %ax
mov %ax , %ds
movb $1 , (0x60)

이거와

outb $1 , 0x60

과는 차이가 있는것인가요?

너무 초보적이네요..^^

쿨링팬의 이미지

Quote:
실제 메모리 0x6X가 키보드 컨트롤러의 I/O 포트에 매핑 되어있는것인가요?

아래가 답변이 될 수 있을듯 합니다.
Quote:
While some CPU manufacturers implement a single address space in their chips, some others decided that peripheral devices are different from memory and therefore deserve a separate address space. Some processors (most notably the x86 family) have separate read and write electrical lines for I/O ports, and special CPU instructions to access ports.

Linux Device Driver 2nd edition을 보시면 도움이 많이 될듯 싶습니다.
http://www.xml.com/ldd/chapter/book/ch08.html

hwandori의 이미지

감사합니다..공부가 많이 필요하겠군요..열심히 해야겠습니다..^^