Search found 12 matches
- Mon May 28, 2012 7:30 am
- Forum: Beginning OS Development
- Topic: getting physical address from virtual and vice versa
- Replies: 1
- Views: 41046
getting physical address from virtual and vice versa
Hi, I am following the OS development tutorial to write my own OS. I am trying to implement multi-tasking in kernel mode. I need to have functions to 1. translate virtual address to physical address. - This is required to get the physical address of page directory lo load in the cr3 register. 2. tra...
- Sat May 19, 2012 10:10 am
- Forum: Beginning OS Development
- Topic: using the virtual memory manager
- Replies: 3
- Views: 51482
Re: using the virtual memory manager
Hi, I have a query about the vmmngr_map_page function. Following is the implementation void vmmngr_map_page (void* phys, void* virt) { //! get page directory pdirectory* pageDirectory = vmmngr_get_directory (); //! get page table pd_entry* e = &pageDirectory->m_entries [PAGE_DIRECTORY_INDEX ((uint32...
- Tue May 15, 2012 11:22 pm
- Forum: Beginning OS Development
- Topic: using the virtual memory manager
- Replies: 3
- Views: 51482
- Tue May 15, 2012 6:32 am
- Forum: Beginning OS Development
- Topic: using the virtual memory manager
- Replies: 3
- Views: 51482
using the virtual memory manager
I am thinking of implementing a heap allocator on top of virtual memory manager. However I am wondering if it is possible to access the virtual memory manager only through the interface. The function provided the VMM to allocate a page is bool vmmngr_alloc_page (pt_entry* e) { //! allocate a free ph...
- Thu May 10, 2012 1:15 am
- Forum: Beginning OS Development
- Topic: memory size calculation from multiboot
- Replies: 4
- Views: 58832
memory size calculation from multiboot
Hi,
I did not understand the calculation of memory size from the fields in multiboot structure.
Please explain the addition of 1024 and multiplication by 64.
I did not understand the calculation of memory size from the fields in multiboot structure.
Code: Select all
uint32_t memSize = 1024 + bootinfo->m_memoryLo + bootinfo->m_memoryHi*64;
- Sat Apr 28, 2012 10:20 am
- Forum: Beginning OS Development
- Topic: higher half kernel and identity-mapping
- Replies: 6
- Views: 73054
Re: higher half kernel and identity-mapping
It is certainly possible to use memory above the 1Mb limit in Real mode. Thanks a lot for explaining how unreal mode works! I am happy after reading it :) However here the question was whether the bootloader in the tutorial can access memory over 1 MB or not and my understanding is that the bootloa...
- Wed Apr 25, 2012 10:48 pm
- Forum: Beginning OS Development
- Topic: higher half kernel and identity-mapping
- Replies: 6
- Views: 73054
Re: higher half kernel and identity-mapping
The tutorial is slightly misleading in this part. The bootloader used by the tutorials cannot load anything above 1 MB. Because of this, the kernel is loaded at address 0x3000, instead of 1MB. However, the page mappings are done in such a way that the kernel still runs at 3GB virtual when paging is...
- Mon Apr 23, 2012 11:09 am
- Forum: Beginning OS Development
- Topic: higher half kernel and identity-mapping
- Replies: 6
- Views: 73054
Re: higher half kernel and identity-mapping
Thanks a lot!!
- Tue Apr 17, 2012 3:05 am
- Forum: Beginning OS Development
- Topic: higher half kernel and identity-mapping
- Replies: 6
- Views: 73054
higher half kernel and identity-mapping
Hi, I have queries about memory management and higher half kernels which have been troubling me for quite some time. The tutorial mentions - A Higher Half Kernel is a kernel that has a virtual base address of 2GB or above. My understanding is that if the kernel has virtual addresses V then all the a...
- Tue Apr 17, 2012 2:57 am
- Forum: Beginning OS Development
- Topic: Physical Memory Manger
- Replies: 4
- Views: 76478
Re: Physical Memory Manger
When the bootloader is reading the kernel into memory, it does that one sector (512 bytes) at a time. It keeps track of the amount of sectors that it read, and passes that value to the kernel in the DX register. The kernel saves it in the kernelSize variable, and multiplies it by 512 to get the ker...
- Wed Apr 11, 2012 11:04 pm
- Forum: Beginning OS Development
- Topic: Physical Memory Manger
- Replies: 4
- Views: 76478
Re: Physical Memory Manger
Thanks a lot! I was wondering about marking the kernel region as occupied. It is not mentioned in the tutorial but it's there in the source code. There's one more thing I would like to ask. Could you please tell how the kernel size is calculated and why is it multiplied by 512 when passing it to pmm...
- Fri Apr 06, 2012 7:49 pm
- Forum: Beginning OS Development
- Topic: Physical Memory Manger
- Replies: 4
- Views: 76478
Physical Memory Manger
Hi, I am following the OS development tutorial and I am at the Physical Memory Manager section. I have a query related to the function for allocation a block of memory. void* pmmngr_alloc_block () { if (pmmngr_get_free_block_count() <= 0) return 0; //out of memory int frame = mmap_first_free (); if ...