Return to BSD News archive
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!howland.reston.ans.net!zaphod.mps.ohio-state.edu!uwm.edu!rutgers!njitgw.njit.edu!hertz.njit.edu!kxn3796 From: kxn3796@hertz.njit.edu (Ken Nakata CIS stnt) Newsgroups: comp.os.386bsd.questions Subject: A question about mmap(2) Summary: Why does not /dev/mem have mmap entry? Message-ID: <1993Apr10.214339.11646@njitgw.njit.edu> Date: 10 Apr 93 21:43:39 GMT Sender: news@njit.edu Organization: New Jersey Institute of Technology, Newark, N.J. Lines: 37 Nntp-Posting-Host: hertz.njit.edu Why does not /dev/mem have mmap entry? Amancio Hasty wrote in comp.sys.ibm.pc.hardware on Mar. 20, >Also, the local bus S3 805/928 cards have a nice feature that they map >the video ram when using Linear mode to 0x7c000000 as supposed to >0xa0000,hence, without operating system support we can not use >linear mode in those cards. (It is upto the vga board manufacturer >how to wire the top six bits.) However, this feature will allow >us to map the entire video ram into memory. It would be nice if the following code fragment works; fd = open("/dev/mem", O_RDWR); if (fd < 0) { perror("xxx: can't open /dev/mem"); exit(1); } addr = mmap(0, 4194304L /* 4M byte */, PROT_READ | PROT_WRITE, MAP_FILE, fd, 0x7c000000L); if ((int)addr == -1) { perror("xxx: can't mmap"); exit(1); } Do I miss any flaw with this? Thanks in advance. Ken Nakata P.S. Probably I don't fully understand mmap system call. The man page is only the document of mmap that I could find. -- /* I apologize if there are incorrect, rude, and/or impolite expressions in this mail or post. They are not intended. Please consider that English is a second language for me and I don't have full understanding of certain words or each nuance of a phrase. Thank you. -- Ken Nakata, CIS student, NJIT */