Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!bloom-beacon!snorkelwacker!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uwm.edu!psuvax1!psuvm!EXETER!PILLAY.KDA From: PILLAY.KDA@EXETER.AC.UK Newsgroups: comp.os.minix Subject: Calloc, malloc and physical addresses on the PC Message-ID: Date: 6 Feb 90 21:12:28 GMT Sender: Minix operating system Reply-To: INFO-MINIX@UDEL.EDU Lines: 19 Approved: NETNEWS@PSUVM Gateway Via: UK.AC.EX; 6 FEB 90 22:12:31 GMT How! Can anyone tell me how to obtain the physical 20-bit address for data allocated using "calloc" or "malloc"? Under TurboC I have the following: unsigned char *ptr .. ptr = (char *) calloc(num, sizeof(ptr)) off = ((unsigned) (ptr)) seg = ((unsigned) ((unsigned long) (ptr) >> 16)) gives me a physical address " seg:off ". Under MINIX, ptr would only be 2 bytes long. I looked at the floppy.c driver and that uses "umap(...)" from kernel/system.c which in turn needs to extract info from a user process etc.. I am programming the DMA controller on the PC and all I want to do is allocated some memory, using calloc, and program the controller with the Physical 20 bit address of where ptr points. Thanks.