From: av568 AT rgfn DOT epcc DOT edu (Beautiful Savior Lutheran Church) Newsgroups: comp.os.msdos.djgpp Subject: Re: DPMI question Date: 27 Apr 1997 18:35:49 GMT Organization: The Rio Grande Free-Net, El Paso Community College, El Paso, TX Lines: 44 Distribution: world Message-ID: <5k06a5$d34@news.epcc.edu> References: <5juo4b$6h9 AT lion DOT cs DOT latrobe DOT edu DOT au> NNTP-Posting-Host: rgfn.epcc.edu To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Gregary J Boyles (boylesgj AT lion DOT cs DOT latrobe DOT edu DOT au) wrote: > What is the difference between __dpmi_lock_linear_region(...) and > _go32_dpmi_lock_code(...)/_go32_dpmi_lock_data(...)? __dpmi_lock_linear_region requires a selector passed to it. Calling _go32_dpmi_lock_code will provide it with your code segment, while _go32_dpmi_lock_data sends your data segment. > In an example key board handler (assembly language) I have read the code > and data are all locked together in one hit with the DPMI lock linear > region function. I am writing a key board handler in C++ so is there any > reason why I can't just stick dummy functions at the very top and very > bottom of my source and lock everything (code and data) in one go with > __dpmi_lock_linear_region(...)? No. Code and data must be locked seperately because they are stored in different segments. > Does this mean that, for the address of my dummy function which marks the > start of my lock region, I should set the address data member to the > address of my dummy function + __djgpp_base_address? No. Just call the appropriate _go32_dpmi_lock_x function; it does the dirty work for you. (BTW, this is said in the FAQ. You should use go32 functions rather than dpmi functions whenever possible because go32 functions do critical dirty work while dpmi functions just call the plain API functions.) > One other question. If I wanted to reboot the computer from inside a > program I presume I would have to set IP to F000:FFF0 but I am unsure how > to do so since IP is 16 bits (isn't it?) and F000:FFF0 is 32 bits. Some > appropriate inline assembler would be helpfull. You cannot reboot the computer from protected mode in this fashion. Well, sometimes you can, but generally you will just freeze the computer. (This is best seen under Windows, which will produce the little infamous "Waiting for system shutdown." box) -- Beautiful Savior Evangelical Lutheran Church - av568 AT rgfn DOT epcc DOT edu We have what you need-- A Savior!