Search found 92 matches
- Sat Aug 07, 2010 1:07 pm
- Forum: General Programming
- Topic: OS Development Series code question
- Replies: 34
- Views: 159105
Re: OS Development Series code question
0xC0000000 is 3 GB, so the new stack would be at 0xBFFFFFFB (3GB - 4 bytes, growing downwards.) I'm going to relocate the stack before the kernel uses anything of it, so I only need to adjust the stack pointers. So, all I have to do is mov esp, BFFFFFFBh and I'm done, or do I need to set ss to some ...
- Wed Jul 21, 2010 7:41 pm
- Forum: General Programming
- Topic: OS Development Series code question
- Replies: 34
- Views: 159105
Re: OS Development Series code question
The bootloader sets up an initial stack for the kernel to use, but I'm free to have the kernel create itself a new one anywhere I want, right?
Also, do I have to clear the old one, or could I just set the registers to point to the new stack location?
Also, do I have to clear the old one, or could I just set the registers to point to the new stack location?
- Tue Jul 20, 2010 8:24 pm
- Forum: General Programming
- Topic: OS Development Series code question
- Replies: 34
- Views: 159105
Re: OS Development Series code question
tbh, the setup routine for your kernel should map the stack to the 3GB mark in memory or something. Thats what happens in most modern operating systems. That means the kernel will have to move... it's currently located at 3GB virtual. Would you happen to know where most OSs map their kernel? Also, ...
- Tue Jul 20, 2010 7:05 pm
- Forum: General Programming
- Topic: OS Development Series code question
- Replies: 34
- Views: 159105
Re: OS Development Series code question
I assume this is the code (in the 2nd stage bootloader) I'm supposed to modify? mov ax, 0x0000 ; stack begins at 0x9000-0xffff mov ss, ax mov sp, 0xFFFF A little calculation tells me I currently have a 27K stack? 0xffff = 63K 0x9000 = 36K 63 - 36 = 27K I guess if I'd change it to get a 128K stack, I...
- Tue Jul 20, 2010 5:54 pm
- Forum: General Programming
- Topic: OS Development Series code question
- Replies: 34
- Views: 159105
Re: OS Development Series code question
When you are working with structures like that, ensure that they are packed structures. Compilers will typically word-align all items in a structure to make memory accesses faster. When you are looking for a specific bit pattern on disk, this makes things wrong. That might explain why junk is being...
- Tue Jul 20, 2010 2:00 pm
- Forum: General Programming
- Topic: OS Development Series code question
- Replies: 34
- Views: 159105
Re: OS Development Series code question
I took a look at the bootsector of my floppy disk with a Hex-editor, and it makes me wonder why on Earth it won't place the correct values into the bpb structure. Every value is what it's supposed to be, yet the values in the struct are garbage. This appears to be caused by the exceptionally weird f...
- Sun Jul 11, 2010 11:31 pm
- Forum: Beginning OS Development
- Topic: Chapter 22 update - when??
- Replies: 2
- Views: 10016
Re: Chapter 22 update - when??
If you really want to have Mike write the code that allows writing to the floppy drive, patience is a virtue. This OS Development Series is being maintained in his spare time, which explains the (sometimes) long waits between updates. If you don't want to wait, you can go ahead and try to turn a cop...
- Thu Jul 08, 2010 9:33 pm
- Forum: General Programming
- Topic: OS Development Series code question
- Replies: 34
- Views: 159105
Re: OS Development Series code question
C++ does name mangling meaning that "int __cdecel _purecall_handler(void)" will appear to the linker as "?_purecall_handler@@YAXXZ" or similar (its compiler depdentent, and even different between different versions of the same compiler - its a nightmare for linking complicated object files). extern...
- Mon Jul 05, 2010 6:17 pm
- Forum: General Programming
- Topic: OS Development Series code question
- Replies: 34
- Views: 159105
Re: OS Development Series code question
Another thing worth mentioning... the _purecall_handler doesn't work. Even though it'll be a while until I'll be able to do multitasking, I've gone ahead and created a DLL project, (mscorlib.dll) which uses several interface classes with pure virtual functions to force their implementation. When com...
- Mon Jul 05, 2010 6:10 pm
- Forum: C and C++
- Topic: Visual C++ compiling help
- Replies: 22
- Views: 105473
Re: Visual C++ compiling help
Perhaps I should have been clearer - we were arguing about C. I think that's where we started to confuse each other. I was under the impression ('cause the topic title says Visual C++) that we were talking about C++ [offtopic] However, IIRC the XDK standard library exposes windows fibers interface ...
- Mon Jul 05, 2010 8:12 am
- Forum: C and C++
- Topic: Visual C++ compiling help
- Replies: 22
- Views: 105473
Re: Visual C++ compiling help
the xbox is most definitly a multitasking environment Actually, no. The XBOX (not XBOX360) kernel does not support more than one XBE (XBOX Executable) running at any given time, nor does it support DLLs. It wouldn't be feasible with only 64MB, which has to be shared between the program and the fram...
- Tue Jun 29, 2010 9:49 am
- Forum: C and C++
- Topic: Visual C++ compiling help
- Replies: 22
- Views: 105473
Re: Visual C++ compiling help
An array is just a pointer to a specific range of memory. Consider this: for(int i = 0; i < 32; i++) { arr[i] = somevalue; *ptr++ = somevalue; } Both statements have the same effect, though stepping through a pointer like this is extremely dangerous considering the fact you might go beyond the data ...
- Mon Jun 21, 2010 8:54 pm
- Forum: General Programming
- Topic: OS Development Series code question
- Replies: 34
- Views: 159105
Re: OS Development Series code question
Unfortunately, that doesn't help me. Through a couple of DebugPrintf() functions in the FAT12 driver, I found out the cause; the values read from the bootsector are rubbish. My OS tells me I have: 51136 Sectors 24404 FAT Size 45 Root entries A root size of 0 And, last but not least... a root offset ...
- Mon Jun 21, 2010 9:08 am
- Forum: Beginning OS Development
- Topic: Virtual PC VHD Boot
- Replies: 6
- Views: 17013
Re: Virtual PC VHD Boot
I don't really get why you'd set the text attributes. Black & white (0x07) is the default color scheme in real mode. And mov bh, 0x00? what's that for? PrintChar: mov ah, 0x0e ; Nope-Print the character mov bh, 0x00 ; Page no. mov bl, 0x07 ; Text attribute 0x07 is lightgrey font on black background ...
- Mon Jun 21, 2010 8:45 am
- Forum: General Programming
- Topic: OS Development Series code question
- Replies: 34
- Views: 159105
Re: OS Development Series code question
I tried it out, and it hangs, just like my own version. It's like (I don't remember his name) said; "when reading a non-existing file, it loops indefinately." Though the file I'm attempting to read does exist. My own OS already uses the suggested fix in the PMM and VMM init; it doesn't fix the error...