I've encountered a problem about including some libs..

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Charlie
Posts: 4
Joined: Sat Jun 27, 2009 10:24 am

I've encountered a problem about including some libs..

Post by Charlie »

I've tried to use VBE func. For that, of course, i must use int 10, don't I?

Here is a problem. I included <go32.h> and <dpmi.h> then I compiled it. It's successful. It made "graphic.o" file.

then I liked with other object files such as kernel.o , memorymanager.o, boot.o and so on.

It occured the erorrs that "undefined reference to '__dpmi_int'", "undefined reference to 'dosmemget'", "undefined reference to '_go32_info_block'" and so on...

I thought when object file is made, it includes thoes func... so it doesn't matter, I thought.

Actually it's my first time developing Operating System. So I don't have any experience developing without libraries.

So, it's kinda hard to me. :) ha ha..;;

Anyway I've searched about VBE. Then I've found some materials. But all of them include <go32.h>, <dpmi.h> or <dos.h>

and so on... , so I tried to include thoes files. But I thought that when I develop OS, I can't include other files. I have to

make my own libraries... THat's what I thought... by the way... If you could help me to make a sense about developing OS

or using thoes funcs, '__dpmi_int', 'dosmemget', '_go32_info_block', I would appreciate it. Thanks for reading it.
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: I've encountered a problem about including some libs..

Post by NickJohnson »

Your kernel can't possibly use DOS/Windows libraries - it runs on the bare hardware. You need to build everything without using any system libraries. You may want to get the kernel actually booting before trying to implement VBE.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: I've encountered a problem about including some libs..

Post by neon »

make my own libraries.
Making your own libraries is your best bet. You can use existing libraries so long as they are not tied to specific operating systems.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: I've encountered a problem about including some libs..

Post by Love4Boobies »

IIRC, Go32 was a DOS extender (Go32v2 became more populat since, btw). It offered services to use extended/expanded memory via DOS drivers. DPMI (DOS Protected Mode Interface) offered one such API which combined interfaces to both EMS and XMS. It was the successor of VCPI (Virtual Control Program Interface) which attempted to do the same but for some reason never became very popular.

The need for such programs was (I'm talking about extenders in general) was caused by MS-DOS being a 16-bit real mode operating system and programs needing to access more than 1 MiB + 64 KiBs (aka the HMA, when the A20 gate was enabled) of memory. Modern operating systems don't run in real mode anymore so there's not much need to use extenders. Even if you design a real mode operating system like DOS, if you don't care about it being compatible with DOS-era computers you can always just write one of these "extenders" yourself: you just have to jump from real mode to protected mode and map memory you use to somewhere you can reach in real mode. Alternatively, you could jump to unreal mode. I think the OSDev wiki offers info on how to do most of the steps you need. You just need to have a global idea.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: I've encountered a problem about including some libs..

Post by jal »

Love4Boobies wrote:It was the successor of VCPI (Virtual Control Program Interface) which attempted to do the same but for some reason never became very popular.
VCPI, iirc, was an extension of EMM386 that allowed a program to get EMM386 (the sole protected mode user in DOS land) to relinquish its control to the program. With the advance of Win95 this method was not feasible anymore, and DPMI was introduced. DPMI is a bit like VCPI, but instead of Windows relinquising control, it offers to do certain thinks for you.


JAL
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: I've encountered a problem about including some libs..

Post by jal »

Charlie wrote:Then I've found some materials. But all of them include <go32.h>, <dpmi.h> or <dos.h> and so on... , so I tried to include thoes files. But I thought that when I develop OS, I can't include other files. I have to make my own libraries... THat's what I thought... by the way... If you could help me to make a sense about developing OS or using thoes funcs, '__dpmi_int', 'dosmemget', '_go32_info_block', I would appreciate it. Thanks for reading it.
Despite all the other comments above being useful, I try to offer some more practical advise then just "build your own libraries". What you should understand is that if your OS runs in protected mode, you cannot directly call INT 10h since this is a real mode interface, which is incompatible with protected mode (if you are wondering why, then I would suggest giving up making an OS for now, and instead research your material a bit better). There are several ways of calling INT 10h from protected mode, and if I am not mistaken, these methods have been discussed at length in this forum, and they are covered as well on our wiki.


JAL
Post Reply