Setting up MSVC++
Moderator:Moderators
Oh while im typing this just a quick (unimportant)note but when using tabbed browsing withon your site I have to keep logging in but, anyway..
Well this is about the "Operating Systems Development - Setting up MSVC++ 2005" tutorial.. I downloaded the demo and tried compiling it on Visual C++ 2005 and it worked.. I copied the new stage2 bootloader onto my disk (It already had the 1st stage one).. And it doesnt load the 3rd stage properly just reboots.. Am I doing something wrong?.. I know my test machine should be okay I mean its new-ish, x86 and can run XP quite well lol... Ooh and everythings worked uptill now when I try and add c++ into it..
Ive tried countless hours of fiddling but still no luck hmmm.. so yeah.. anyone know what to do lol..
Thanks
Well this is about the "Operating Systems Development - Setting up MSVC++ 2005" tutorial.. I downloaded the demo and tried compiling it on Visual C++ 2005 and it worked.. I copied the new stage2 bootloader onto my disk (It already had the 1st stage one).. And it doesnt load the 3rd stage properly just reboots.. Am I doing something wrong?.. I know my test machine should be okay I mean its new-ish, x86 and can run XP quite well lol... Ooh and everythings worked uptill now when I try and add c++ into it..
Ive tried countless hours of fiddling but still no luck hmmm.. so yeah.. anyone know what to do lol..
Thanks
Hey,
Does it work with your new stage2 bootloader running in Bochs? Or does it reboot ("Triple Fault") in both Bochs and your test computer?
Thats great to hearI downloaded the demo and tried compiling it on Visual C++ 2005 and it worked.
Can you please elaborate on what you mean by "new stage2 bootloader"? Also, what "disk"? Floppy disk? A file on your hard drive?I copied the new stage2 bootloader onto my disk (It already had the 1st stage one).. And it doesnt load the 3rd stage properly just reboots..
Does it work with your new stage2 bootloader running in Bochs? Or does it reboot ("Triple Fault") in both Bochs and your test computer?
Lead Programmer for BrokenThorn Entertainment, Co.
Website: http://www.brokenthorn.com
Email: webmaster@brokenthorn.com
Website: http://www.brokenthorn.com
Email: webmaster@brokenthorn.com
By the new 2nd stage bootloader I mean i ran Demo5\SysBoot\Stage2\build.bat and it worked.. Cuz I noted you had changed Stage2.asm etc..
By disk I mean my great new usb floppy drive =D.. which took forever to order in and then it didnt even go but thats a different story.. but it works now
Umm Ive never gotten Bochs to work on Vista and its all I can get running at the moment...
By disk I mean my great new usb floppy drive =D.. which took forever to order in and then it didnt even go but thats a different story.. but it works now
Umm Ive never gotten Bochs to work on Vista and its all I can get running at the moment...
...Did you manage to get it working? o.0but it works now
There is a newer version of Bochs then that listed in the series. I am going to have to see if it is Vista compatible..Umm Ive never gotten Bochs to work on Vista and its all I can get running at the moment...
You can use other emulators (QEMU is nice) if you cannot get Bochs to work.
Lead Programmer for BrokenThorn Entertainment, Co.
Website: http://www.brokenthorn.com
Email: webmaster@brokenthorn.com
Website: http://www.brokenthorn.com
Email: webmaster@brokenthorn.com
Yeah I got my floppy drive working.. well got a replacement lol.. Itll write all the tutorials that only use nasm and my test machine will boot them all fine.
Just when I boot with the c++ tutorial it loads stage2, prints "Searching for Operating System..." to the screen and then triple faults..
Oh okay.. ill go have a look at them.. I dont really get what point having an emulator is though when ive got the real thing next to me and it takes like 30 seconds to copy onto a disk, boot, and stuff..
Just when I boot with the c++ tutorial it loads stage2, prints "Searching for Operating System..." to the screen and then triple faults..
Oh okay.. ill go have a look at them.. I dont really get what point having an emulator is though when ive got the real thing next to me and it takes like 30 seconds to copy onto a disk, boot, and stuff..
Running this in an emulator is much safer then real hardware. Please see <a href="http://www.brokenthorn.com/Resources/OS ... ">Tutorial 9</a>, Under the section <b>Cautions to look for</b> for more information.Oh okay.. ill go have a look at them.. I dont really get what point having an emulator is though when ive got the real thing next to me and it takes like 30 seconds to copy onto a disk, boot, and stuff..
Also, emulators (Like Bochs) may come with debuggers to help catch these problems
Hm... It sounds like there is a problem loading the kernel, or executing it. When you compile the MSVC++ Kernel, have it output a linker map. This way we can insure the entry point is where it should be, as well as other base addresses.ust when I boot with the c++ tutorial it loads stage2, prints "Searching for Operating System..." to the screen and then triple faults..
^This is the only difference between the two tutorials. As the previous version works, I suspect the problem is one of these areas.
Lead Programmer for BrokenThorn Entertainment, Co.
Website: http://www.brokenthorn.com
Email: webmaster@brokenthorn.com
Website: http://www.brokenthorn.com
Email: webmaster@brokenthorn.com
Yeah I know about that.. Though if my computer breaks ive got like 15 more capable of runinng this stuff lol..
Oh but debuggers that sounds usefull I hadent realized..
I checked and that was allready set I tried compiling exacally with the settings I downloaded it as and it worked.. Oh I had to comment out one line, which I thought was useless?,or it wouldnt work though..
In the file asm\io.cpp it had the line
And I checked and ALL of the settings in the tutorial you said to do have been done..
Oh but debuggers that sounds usefull I hadent realized..
I checked and that was allready set I tried compiling exacally with the settings I downloaded it as and it worked.. Oh I had to comment out one line, which I thought was useless?,or it wouldnt work though..
In the file asm\io.cpp it had the line
Code: Select all
#include <asm>
Oh and if this is any help?
1>------ Build started: Project: Kernel, Configuration: Debug Win32 ------
1>Compiling...
1>io.cpp
1>mainCRTstartup.cpp
1>cstd.cpp
1>Main.cpp
1>Generating Code...
1>c:\users\michael\os dev\c++\syscore\lib\cstd.cpp(144) : warning C4702: unreachable code
1>Linking...
1>LINK : warning LNK4216: Exported entry point _mainCRTStartup
1> Creating library A:\KRNL.lib and object A:\KRNL.exp
1>A:\KRNL.dll : warning LNK4086: entrypoint '_mainCRTStartup' is not __stdcall with 12 bytes of arguments; image may not run
1>cstd.obj : warning LNK4254: section '.CRT' (40000040) merged into '.data' (C0000040) with different attributes
1>Order.txt : warning LNK4037: '_kmain' does not exist; ignored
1>LINK : warning LNK4096: /BASE value '0x100000' is invalid for Windows 95 and Windows 98; image may not run
1>Build log was saved at "file://c:\Users\Michael\OS DEV\c++\SysCore\Kernel\Debug\BuildLog.htm"
1>Kernel - 0 error(s), 6 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
1>------ Build started: Project: Kernel, Configuration: Debug Win32 ------
1>Compiling...
1>io.cpp
1>mainCRTstartup.cpp
1>cstd.cpp
1>Main.cpp
1>Generating Code...
1>c:\users\michael\os dev\c++\syscore\lib\cstd.cpp(144) : warning C4702: unreachable code
1>Linking...
1>LINK : warning LNK4216: Exported entry point _mainCRTStartup
1> Creating library A:\KRNL.lib and object A:\KRNL.exp
1>A:\KRNL.dll : warning LNK4086: entrypoint '_mainCRTStartup' is not __stdcall with 12 bytes of arguments; image may not run
1>cstd.obj : warning LNK4254: section '.CRT' (40000040) merged into '.data' (C0000040) with different attributes
1>Order.txt : warning LNK4037: '_kmain' does not exist; ignored
1>LINK : warning LNK4096: /BASE value '0x100000' is invalid for Windows 95 and Windows 98; image may not run
1>Build log was saved at "file://c:\Users\Michael\OS DEV\c++\SysCore\Kernel\Debug\BuildLog.htm"
1>Kernel - 0 error(s), 6 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
When you build your MSVC++ Kernel, The linker map should output to Demo5/SysCore/Kernel/Kernel.map - would you mind posting that for us?
Also, you do not need to worry about those warnings.
*Demo5 uses the same file and floppy code as Demo 4. Because Demo4 works fine (I assume), we know the file loading code is working fine. I am suspecting it is the MSVC++ image, but need to make sure.
Also, you do not need to worry about those warnings.
*Demo5 uses the same file and floppy code as Demo 4. Because Demo4 works fine (I assume), we know the file loading code is working fine. I am suspecting it is the MSVC++ image, but need to make sure.
Lead Programmer for BrokenThorn Entertainment, Co.
Website: http://www.brokenthorn.com
Email: webmaster@brokenthorn.com
Website: http://www.brokenthorn.com
Email: webmaster@brokenthorn.com
Hmm... Have you tried it on different computers to see what happens? Is your test machine a PC or laptop?
Lead Programmer for BrokenThorn Entertainment, Co.
Website: http://www.brokenthorn.com
Email: webmaster@brokenthorn.com
Website: http://www.brokenthorn.com
Email: webmaster@brokenthorn.com
Hmm theyre all in storage.. wait there is one I could try tho... cuz im moving house lol... Um its a pc...
Oh but I think Ive found the problem now.. I modified Stage2 to dump the first few hundrend bytes starting at 1MB onto the screen and it turns out its not the kernal wich I found there at all.... it was the stage2 loader I have no idea what thats doing there tho.. maybe it loaded the wrong file or something?
Oh but I think Ive found the problem now.. I modified Stage2 to dump the first few hundrend bytes starting at 1MB onto the screen and it turns out its not the kernal wich I found there at all.... it was the stage2 loader I have no idea what thats doing there tho.. maybe it loaded the wrong file or something?
That is interesting. Perhaps stage2 is loading itself?
Insure Stage 2 is loading KRNL.DLL to 0x100000 (1MB) (or 0xffff:0x10 in seg:offset mode.) Or, in demo4, incure it is loading KRNL.SYS.
Insure Stage 2 is loading KRNL.DLL to 0x100000 (1MB) (or 0xffff:0x10 in seg:offset mode.) Or, in demo4, incure it is loading KRNL.SYS.
Lead Programmer for BrokenThorn Entertainment, Co.
Website: http://www.brokenthorn.com
Email: webmaster@brokenthorn.com
Website: http://www.brokenthorn.com
Email: webmaster@brokenthorn.com