Search found 59 matches

by xixpsychoxix
Sat Nov 07, 2009 12:02 am
Forum: Beginners
Topic: Char *
Replies: 11
Views: 31303

Re: Char *

Im not really sure what you mean there. If you mean that if your code checked to see if the value pointed to was null you could do whatever you feel like with the pointer with no ill effects im afraid that this is incorrect. Actually it is pretty much unsafe to do what you are trying to do at all du...
by xixpsychoxix
Fri Nov 06, 2009 4:37 pm
Forum: Beginners
Topic: Char *
Replies: 11
Views: 31303

Re: Char *

No, really it isnt because there is still not enough space allocated for the whole 11-byte filename. the compiler in this case will just put a null character (\0) in memory and then give you a pointer to it. That does not, however, mean that the bytes following it are not some other data or code. th...
by xixpsychoxix
Thu Nov 05, 2009 3:34 am
Forum: Beginners
Topic: Loading file data under fat12
Replies: 12
Views: 31273

Re: Loading file data under fat12

actually 7186 is the size of the root directory in bytes for my floppy: int root_size = (diskdat->RootEntries * 32) / diskdat->BytesPerSector; and it works out to 7186 because diskdat->RootEntries == 224 && diskdat->BytesPerSector == 512. And since i couldnt use an equation to dimension the array an...
by xixpsychoxix
Wed Nov 04, 2009 6:03 pm
Forum: Beginners
Topic: Loading file data under fat12
Replies: 12
Views: 31273

Re: Loading file data under fat12

I solved the problem by changing buffer[7186] from a local variable to a global variable and for some odd reason it worked. if anyone has an explanation for that i would love to hear it so please let me know!
by xixpsychoxix
Wed Nov 04, 2009 5:27 pm
Forum: Beginners
Topic: Loading file data under fat12
Replies: 12
Views: 31273

Re: Loading file data under fat12

I tried to do what you said about using #define to trick the compiler into using my function, but that didnt seem to work either. I dont believe that it is an optimization problem because even when i turn optimization off i have the same problem. I tried: #pragma optimize ( " ", off) void MyFunction...
by xixpsychoxix
Tue Nov 03, 2009 8:48 pm
Forum: Beginners
Topic: Char *
Replies: 11
Views: 31303

Re: Char *

well the point isnt that it's unsafe to use pointers, just pointers that are unallocated. that means that when you declare something like: char a[10]; the compiler will then set aside ten free bytes for this array. but if you declare something like: char *a; the compiler will only allocate a pointer...
by xixpsychoxix
Tue Nov 03, 2009 11:31 am
Forum: Beginners
Topic: Loading file data under fat12
Replies: 12
Views: 31273

Re: Loading file data under fat12

I have it set to ignore default libraries and it still isnt working. i also tried every optimization level and on some it has less errors but mostly its all the same.
by xixpsychoxix
Mon Nov 02, 2009 10:19 pm
Forum: Beginners
Topic: Char *
Replies: 11
Views: 31303

Re: Char *

the major problem that i see with using a char * as a string in an os is this: char *string = "Hello", *copy; while (*string++ == *copy++) ; You would expect this code to copy string into copy, but the problem is that copy is unallocated, meaning that it is completely unsafe to use it the way it is....
by xixpsychoxix
Mon Nov 02, 2009 7:40 pm
Forum: Beginners
Topic: Loading file data under fat12
Replies: 12
Views: 31273

Re: Loading file data under fat12

I cant find the compiler option for built-in functions under visual studio. are you sure it's under the c++ advanced tab?
by xixpsychoxix
Mon Nov 02, 2009 4:32 am
Forum: Beginners
Topic: Loading file data under fat12
Replies: 12
Views: 31273

Loading file data under fat12

Ok, so i have been working on some of my own code to locate a file in the root directory. Here is the code I have so far for the load: struct diskinfo_FAT12 { uint8_t jmp1; uint8_t jmp2; uint8_t jmp3; uint8_t OEM_Name[8]; uint16_t BytesPerSector; uint8_t SectorsPerCluster; uint16_t ReservedSectors; ...
by xixpsychoxix
Sun Oct 18, 2009 5:56 am
Forum: Beginners
Topic: Page Fault Problems
Replies: 4
Views: 18085

Re: Page Fault Problems

Well, i made those changes but it didn't seem to help. bochs is still page faulting for some reason but it could be me. ill do some more tests and let u guys know, please keep me posted if something else shows up.
by xixpsychoxix
Wed Oct 14, 2009 4:17 pm
Forum: Beginners
Topic: Page Fault Problems
Replies: 4
Views: 18085

Re: Page Fault Problems

00000003553i[BIOS ] $Revision: 1.231.2.1 $ $Date: 2009/06/07 07:49:09 $ 00000320056i[KBD ] reset-disable command received 00000500000i[WGUI ] dimension update x=720 y=400 fontheight=16 fontwidth=9 bpp=8 00003481424i[WGUI ] IME disabled 00039326283i[PIDE ] new BM-DMA address: 0xc000 00039332166i[P2I...
by xixpsychoxix
Tue Oct 13, 2009 11:11 pm
Forum: Beginners
Topic: Page Fault Problems
Replies: 4
Views: 18085

Page Fault Problems

Ok, since I did the tutorial on virtual memory I have been testing the operating system on multiple sets of hardware. When I test in bochs or on my laptop (pentium M 1.8 ghz dell inspiron 600m) I get page fault errors; however, I have no page fault problem in virtualpc or on my old packard bell lege...
by xixpsychoxix
Tue Oct 13, 2009 8:55 pm
Forum: Beginners
Topic: FDC Tutorial Problems
Replies: 1
Views: 12560

FDC Tutorial Problems

I am mostly using VirtualPC to test my OS, but today i used an old Packard Bell w/ a Pentium 75 mhz processor in it to test the FDC tutorial. For some reason it will not read the sectors. I have the strange feeling that this is due to the fact that the old machine has no dma controller on it, but i ...