Search found 30 matches
- Tue Aug 18, 2009 11:10 pm
- Forum: General Programming
- Topic: Algorithm Challenge
- Replies: 36
- Views: 9884
Re: Algorithm Challenge
I think there will be some problems with your Free routine. Your allocation routine looks okay at first glance. When you free though you can hit a race condition. If you have items: A -> B -> C -> D on your used partition list and you have two threads freeing B & C at the same time then you can ...
- Sat Jun 20, 2009 2:32 pm
- Forum: OS Development
- Topic: problem with bit manipulation
- Replies: 6
- Views: 1359
Re: problem with bit manipulation
Is your user_pde structure correct? I would either use the debugger to step through the code or add some print statements around it so you can see what its actually doing. Your bit manipulation looks fine. My guess would be you're not touching the memory you think you are. *edit: You should zero out...
- Wed Jun 03, 2009 9:56 am
- Forum: OS Development
- Topic: Parsing ACPI tables
- Replies: 6
- Views: 2942
Re: Parsing ACPI tables
Where does it imply the tables are sequential in memory? In section 5.2.4 it says (emphasis mine): The OS locates that Root System Description Table by following the pointer in the Root System Description Pointer structure. The Root System Description Table, shown in Table 5- 4, starts with the sign...
- Fri May 29, 2009 10:16 pm
- Forum: OS Development
- Topic: SMP boot on qemu
- Replies: 2
- Views: 1480
Re: SMP boot on qemu
The minimum you need for Qemu is to enable the APIC and send a SIPI. Note that on real hardware you will need more. But this code works for me (my real code that I'm using does an INIT, SIPI, SIPI sequence with proper timeouts...): #define APIC_SPURIOUS_INTERRUPT_VECTOR 0x0F #define APIC_INTERRUPT_C...
- Mon Apr 27, 2009 10:17 am
- Forum: General Programming
- Topic: Allocating Paragraphs
- Replies: 8
- Views: 2134
Re: Allocating Paragraphs
Here's how I would do it: Instead of having a regular linked list, have it so that the first couple bytes of a free block are used to keep track of the number of free contiguous free blocks AND the number of allocated contiguous blocks following the free block. This way when you get to a free block ...
- Sun Apr 19, 2009 12:19 am
- Forum: General Programming
- Topic: function lenght in C
- Replies: 38
- Views: 6821
Re: function lenght in C
In order to find the offset & length of a function as well as copy it in a way that will actually work you may need to write your own linker (or extend an existing one) and create your own executable format. When you load your executable you can have a table for each function that describes begi...
- Thu Mar 19, 2009 11:41 pm
- Forum: OS Design & Theory
- Topic: Paging design, Lower half kernel, potential problems?
- Replies: 17
- Views: 9471
Re: Paging design, Lower half kernel, potential problems?
Identity mapping the kernel is fine I suppose, but I don't think there's much point in having it visible in ring 3. The reason to use ring 0 is so you can use system instructions that aren't available in ring 3. If the kernel is visible in ring 3 then that means its not marked as system memory and y...
- Sat Feb 28, 2009 8:26 pm
- Forum: OS Development
- Topic: Disk reading
- Replies: 10
- Views: 1562
Re: Disk reading
There are only 2844 clusters on a typical floppy drive but you're trying to read cluster 2896. So of course bochs is complaining that the read is out of range. It must be some problem with your FS code that figures out what cluster to read.
- Sat Feb 21, 2009 2:19 pm
- Forum: OS Development
- Topic: Implementing NUMA
- Replies: 6
- Views: 1837
Re: Implementing NUMA
[*]For kernel data that is normally only read and not modified (including kernel code), a different copy of the data is used in each domain (different physical pages mapped at the same virtual addresses). For example, if there's 4 NUMA domains then there's 4 copies of the kernel's code and read-onl...
- Sat Feb 14, 2009 1:05 pm
- Forum: OS Design & Theory
- Topic: Machine identification
- Replies: 34
- Views: 14124
Re: Machine identification
One problem I can see with having a transactional system is when the apps running on your OS need to communicate with the world outside the cluster. If they aren't aware of when transactions start and end then they may send some data multiple times to an external machine (if a transaction gets abort...
- Thu Jan 15, 2009 10:11 pm
- Forum: OS Development
- Topic: Descriptor Tables
- Replies: 4
- Views: 1184
Re: Descriptor Tables
I would recommend that you start reading the intel or amd manuals for system programming. You can find the amd manuals here: http://www.amd.com/us-en/Processors/Dev ... 44,00.html. Read up on chapter 4, section 4.6 for details on the descriptor tables.
- Tue Jan 13, 2009 10:40 am
- Forum: OS Development
- Topic: Multi Processor Floating Pointer Structure
- Replies: 18
- Views: 3136
Re: Multi Processor Floating Pointer Structure
40:0e is a 16-bit address. To convert it to a linear address you need to do 0x40 * 0x10 + 0x0e = 0x40e.
- Sat Jan 03, 2009 1:03 pm
- Forum: OS Development
- Topic: video memory
- Replies: 12
- Views: 1420
Re: video memory
You're not setting up your segments in 16-bit mode so I'm not sure what the "lgdt [gdt_addr]" line will actually end up loading. I would try changing the first bit to the following: org 0x07c00 bits 16 jmp short start ; load cs start: mov ax, cs mov ds, ax ; load ds mov es, ax ; load es cl...
- Sat Nov 15, 2008 1:18 am
- Forum: OS Design & Theory
- Topic: Paging Questions (amd64)
- Replies: 4
- Views: 5057
Re: Paging Questions (amd64)
You need to map an entry of the page map level 4 table, the page directory pointer table and the page directory table to the pml4 page. This will let you access all levels of the page table hierarchy using a fractal memory map. Here's what my code looks like: pml4 = (PageTable*) KeAllocatePage(); pd...
- Sat Nov 08, 2008 11:54 am
- Forum: OS Development
- Topic: writing kernel in VS 2005
- Replies: 19
- Views: 4577
Re: writing kernel in VS 2005
I don't think the microsoft linker can compile to a flat binary. You can try using some other linker though. Here is a list from the WIKI: http://wiki.osdev.org/Category:Linkers. I would try using JLoc since it was created to solve the problem you're having (note: I haven't used it myself).