'Bogus' Memory
Posted: Sat Jun 14, 2003 6:05 am
As you may have gathered from my previous I'm rewriting my OS with a GUI built in. A lot of the code can just be ripped from my old OS. So far I've added DM and tasks. But a problem which keeps on poping up is with my temporary memory mangement. It works just by adding the size to a pointer to get the pointer for the next request etc. There is no free() yet. With my testing code which just has two tasks. One just waits for a key press then displays it at one coordinate the other constantly prints "HELLO WORLD from TASK2" at another coordinate. At first it all works fine but after several key presses random coloured dashes start to appear(on real PC). It bochs it complains of running in bogus memory. Here is the relevant part of bochsout.txt:-
00190681838p[CPU ] >>PANIC<< prefetch: running in bogus memory
00190681838i[SYS ] Last time is 1055589325
00190681838i[CPU ] protected mode
00190681838i[CPU ] CS.d_b = 32 bit
00190681838i[CPU ] SS.d_b = 32 bit
00190681838i[CPU ] | EAX=00000001 EBX=f000ff53 ECX=00000000 EDX=000000a0
00190681838i[CPU ] | ESP=00000018 EBP=f000ff53 ESI=f000ff53 EDI=f000ff53
00190681838i[CPU ] | IOPL=0 NV UP EI PL NZ NA PO NC
00190681838i[CPU ] | SEG selector base limit G D
00190681838i[CPU ] | SEG sltr(index|ti|rpl) base limit G D
00190681838i[CPU ] | DS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00190681838i[CPU ] | ES:0010( 0002| 0| 0) 00000000 000fffff 1 1
00190681838i[CPU ] | FS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00190681838i[CPU ] | GS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00190681838i[CPU ] | SS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00190681838i[CPU ] | CS:0018( 0003| 0| 0) 00000000 000fffff 1 1
00190681838i[CPU ] | EIP=f000ff53 (f000ff53)
00190681838i[CPU ] | CR0=0x60000011 CR1=0x00000000 CR2=0x00000000
00190681838i[CPU ] | CR3=0x00000000 CR4=0x00000000
I've attached the files from the OS which are relevant to the problem. The test code is in main.c. dm.c is the device manager. The most likely problem files are tasks.c and mm.c. I've spent an age looking for the bug but I can't find it. Please can someone look through the code and suggest problems. If there is any other parts of the OS you need to see just say and I'll post them.
Thanks in advance for any help at all
Pete
PS I think the problem occured once before I added the multitasking but as there was another bug which when I fixed it went away I forgot about it till now
[attachment deleted by admin]
00190681838p[CPU ] >>PANIC<< prefetch: running in bogus memory
00190681838i[SYS ] Last time is 1055589325
00190681838i[CPU ] protected mode
00190681838i[CPU ] CS.d_b = 32 bit
00190681838i[CPU ] SS.d_b = 32 bit
00190681838i[CPU ] | EAX=00000001 EBX=f000ff53 ECX=00000000 EDX=000000a0
00190681838i[CPU ] | ESP=00000018 EBP=f000ff53 ESI=f000ff53 EDI=f000ff53
00190681838i[CPU ] | IOPL=0 NV UP EI PL NZ NA PO NC
00190681838i[CPU ] | SEG selector base limit G D
00190681838i[CPU ] | SEG sltr(index|ti|rpl) base limit G D
00190681838i[CPU ] | DS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00190681838i[CPU ] | ES:0010( 0002| 0| 0) 00000000 000fffff 1 1
00190681838i[CPU ] | FS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00190681838i[CPU ] | GS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00190681838i[CPU ] | SS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00190681838i[CPU ] | CS:0018( 0003| 0| 0) 00000000 000fffff 1 1
00190681838i[CPU ] | EIP=f000ff53 (f000ff53)
00190681838i[CPU ] | CR0=0x60000011 CR1=0x00000000 CR2=0x00000000
00190681838i[CPU ] | CR3=0x00000000 CR4=0x00000000
I've attached the files from the OS which are relevant to the problem. The test code is in main.c. dm.c is the device manager. The most likely problem files are tasks.c and mm.c. I've spent an age looking for the bug but I can't find it. Please can someone look through the code and suggest problems. If there is any other parts of the OS you need to see just say and I'll post them.
Thanks in advance for any help at all
Pete
PS I think the problem occured once before I added the multitasking but as there was another bug which when I fixed it went away I forgot about it till now
[attachment deleted by admin]