1,252 questions
15
votes
2
answers
21k
views
Switching to User-mode using iret
I am writing a small OS that will execute some code in user mode (privilege level 3). From that user level code, I want to call an interrupt back to the OS that prints a message. Right now I don't ...
6
votes
1
answer
818
views
Using LLDT and configuring the GDT for it
I'm working on a small OS that will use a separate Local Descriptor Table for each process. I understand that I will need to use the lldt instruction to load a LDT segment from my GDT. I already ...
3
votes
4
answers
762
views
Using ngen.exe to compile a kernel
I understand that the Cosmos and SharpOS have made their own compilers to build binary code from C#, but could you use Microsoft's .NET AOT to do the same thing? Compiling C# to x86, that is. I assume ...
2
votes
1
answer
584
views
Can Intel processors delay TLB invalidations?
This in reference to InteI's Software Developer’s Manual (Order Number: 325384-039US May 2011), the section 4.10.4.4 "Delayed Invalidation" describes a potential delay in invalidation of TLB entries ...
3
votes
2
answers
604
views
Custom Interrupt Descriptor Table Confusion
I'm writing a small OS that runs under protected mode. I am coming to a point where I want to load a custom interrupt descriptor table, and I don't know where to start. I have read some stuff on the ...
5
votes
1
answer
4k
views
16 bit C code for real mode kernel
I don't know how to compile my C kernel for 16 bit real mode. I have tried a variety of compilers with no luck. My bootloader simply loads raw sectors from the floppy (my kernel lives right after the ...
3
votes
2
answers
2k
views
How to find motherboard info using CPUID?
I am trying to develop a C function for getting some motherboard info (name, id, etc.) but I can't find where these info are stored. I had a look at CPUID but I could't find anything related to the ...
0
votes
1
answer
370
views
OS X, gcc, x86, segmentation, paging, seg fault, bus error
In the case of osx, gcc, modern x86:
How is the x86 segmentation h/w and paging h/w used?
2
votes
2
answers
365
views
Prototype Kernel and modules
Recently I've picked up one of my old projects and restarted it, pretty much from scratch.
I've been sick for awhile, so I've had time to crack down hard and implement tons of functionality. However ...
7
votes
5
answers
9k
views
C without stdio, what is possible?
I've been interested in programming an operating system for some time. Delving through a few different sites, I've come across an interesting concept (to paraphrase): if you start writing your ...
0
votes
1
answer
995
views
Mini OS: Linking the compiled & assembled .o files
I'm trying to set up a working environment for assembling a bootloader and compiling and linking a simple kernel according to this page: enter link description here
So far everything went well, ...
7
votes
1
answer
4k
views
Higher half kernel initialization
When initializing my kernel, I have a few things that need to happen: 1) paging needs to be enabled, 2) the physical memory manager needs to parse the memory map from grub, and 3) assorted startup ...
13
votes
3
answers
35k
views
Return value of a C function to ASM
I'm trying to call a function from within ASM. I know how to call it, but i'm having trouble finding how to get the return value of this function. An example follows:
C code:
int dummy() {
...
3
votes
1
answer
3k
views
NUMA documentations for x86-64 processor?
I have already looked for NUMA documentations for X86-64 processors, unfortunately I only found optimization documents for NUMA.
What I want is: how do I initialize NUMA in a system (this would ...
4
votes
1
answer
2k
views
OS(Operating System) Programming in C# [closed]
I know this project.The question is that "Can we create a real OS with Managed Code or the os that will create with this project is a hello world os?"
Operating Systems need to have full ...
2
votes
1
answer
3k
views
How to get a mouse working in my own operating system? INT 33h doesn't work outside of EMU8086
I have developed an own OS entirely in Assembly, now I want to implement a mouse driver because I see that the INT 33h in Windows with EMU8086 works but when I boot from floppy it doesn't work. I have ...
8
votes
3
answers
9k
views
Simple in memory file system
Can anybody point me to a simple (can't stress this enough) implementation of an in memory file system? If I can create a file and do a simple cat file.txt it's more than enough.
I would like to use ...
2
votes
2
answers
2k
views
Simple toy OS memory management
I'm developing a simple little toy OS in C and assembly as an experiment, but I'm starting to worry myself with my lack of knowledge on system memory.
I've been able to compile the kernel, run it in ...
3
votes
1
answer
1k
views
Using grub in floppy image file to start your own kernel inside bochs
Basically I've followed the instructions here http://sig9.com/bochs-grub to create a bare image file which does nothing but lets the BIOS start GRUB.
The problems are:
The kernel I am writing will be ...
3
votes
2
answers
9k
views
To access PCB of process in C
I am working in Linux and i have a little bit confusion that whether i can access the PCB of process or not? if yes then what content of it we can access it and print them on to the terminal and if ...
4
votes
2
answers
3k
views
Doing a indirect far jump/call in protected mode
How do I perform an indirect far jump/call in protected mode? First I was thinking that doing this is allowable:
jmp 0x10:eax;
(Don't worry about the segment selector..the 2nd entry of my GDT is a ...
1
vote
2
answers
3k
views
Page tables in Linux
Question 1 :- During the booting process, Linux creates the page tables. However, when a new process is executed, it also has its own page table. How are these two tables different?
Question 2 :- On ...
2
votes
1
answer
3k
views
memory mapped i/o operation (in intel processor) using in/out instruction...still be cached?
Will a memory mapped i/o operation (in intel processor) still be cached if the address range of the mapped i/o is being typed as write back (WB) even if I use the in/out instruction?
EDIT:
This ...
0
votes
1
answer
582
views
Can someone expain how I use this C data structure that comes from grub? I don't understand hi mem and lo mem
Grub is a multiboot compliant boot loader. When it boots an operating system it creates a structure defining the available memory and leaves a pointer to that structure in memory.
I got that ...
4
votes
2
answers
1k
views
OS's Boot-loader doesn't work
I am making a custom Operating System. I have two nasm files:
boot.asm:
[BITS 16] ;tell the assembler that its a 16 bit code
[ORG 0x7C00] ;Origin, tell the assembler that where the code will
;...
19
votes
9
answers
9k
views
Best Educational Operating System For Study? [closed]
What's the best operating system to study in order to write your own x86 operating system from scratch?
4
votes
3
answers
1k
views
Resources for writing kernel in C
I don't want to write my own boot loader -- happy to use Grub.
I just want to implement pre-emptive multi threading, a basic file system, and virtual memory.
I want something that can run on top of ...
0
votes
1
answer
2k
views
How to write a Hello World Bootloader for MIPS?
I'm learning MIPS Assembly by the book MIPS Assembly Language Programming, but my I've just started learning MIPS because I want to build a MIPS OS, but now as I can see, there isn't any documentation ...
0
votes
3
answers
2k
views
BIOS INT 0x15 Function 0x88 always returns same memory size
I'm using BIOS int 0x15 on my Bochs emulator, however this always returns the same memory size (34440) no matter what I have configured:
mov ax, 0x88
int 0x15
I know that there are better methods of ...
1
vote
3
answers
3k
views
How To Build a Operating System With C#
I was reading about Singularity and it was developed in part with C#, but how can I develop a operatin system in part with C#?(because the boot loader needs to be in Assembly, that I know) the thing ...
11
votes
5
answers
8k
views
How to load a kernel from disk with BIOS int 13h in NASM assembly?
I've been stuck with this for weeks now and have no idea where I'm going wrong because NASM hasn't given me any errors. The code is pretty self explanatory because of the comments.
this is the code ...
1
vote
1
answer
173
views
What does it take to write a virtualization host?
I'm not planning on doing this right now, as I don't have the experience in this area to even attempt it at the moment, but I'm curious about something.
If implementing an operating system from ...
116
votes
20
answers
52k
views
How can I build a small operating system on an old desktop computer? [closed]
This might be in vain, as I know writing an operating system is unbearably complicated (especially by oneself).
I don't expect to build the next linux, or windows.
I know it will be horrible, and ...
19
votes
17
answers
5k
views
For kernel/OS is C still it? [closed]
I like operating systems and would eventually like to become a OS developer mostly working on kernels. In the future will C still be the language of choice and what else should I be trying to learn?
7
votes
1
answer
4k
views
How do I build a kernel image using Visual Studio?
I'd like to build an embedded kernel for an x86 machine using Visual C++. I have some C and assembly code files to compile and I'd like to link them all together in a way that is compatible with a ...
9
votes
11
answers
12k
views
What is a good barebones linux distro for beginner kernel development?
In my Operating Systems class we are looking to modify a Linux kernel with some simple system calls of our own in C.
What would be a good distro suited for this purpose? We don't need any frills, no ...
7
votes
6
answers
6k
views
Do I have to pop the error code pushed to stack by certain exceptions before returning from the interrupt handler?
I have loaded an idt table with 256 entries, all pointing to similar handlers:
for exceptions 8 and 10-14, push the exception number (these exceptions push an error code automatically)
for the others, ...
7
votes
3
answers
2k
views
How do I programmatically create a bootable CD?
I'm using a barebones tutorial as the basis for an OS I'm working on, and it seems to be an older tutorial: it has be compiling the kernel down to a floppy image, and then loading it with GRUB.
...
9
votes
3
answers
4k
views
How does SMP multithreading share memory and interrupts?
I'm doing some work on the input buffers for my kernel, and I had some questions. On Dual Core machines, I know that more than one "process" can be running simultaneously. What I don't know is how the ...
49
votes
25
answers
24k
views
How are Operating Systems "Made"?
Creating an OS seems like a massive project. How would anyone even get started?
For example, when I pop Ubuntu into my drive, how can my computer just run it?
(This, I guess, is what I'd really ...
19
votes
6
answers
7k
views
Roadblocks in creating a custom operating system [closed]
It seems to me that the most common overly ambitious project that programmers (esp. Comp. Sci. grads) try to tackle is building your own operating system. (Trying to create your own programming ...
10
votes
2
answers
5k
views
Setting up IRQ mapping
I'm following several tutorials and references trying to get my kernel set up. I've come across some unfamiliar code in a tutorial that isn't explaining it at all. It's code that I'm told maps the 16 ...
6
votes
2
answers
3k
views
How does an OS generally go about managing kernel memory and page handling?
I'm working on kernel design, and I've got some questions concerning paging.
The basic idea that I have so far is this: Each program gets its own (or so it thinks) 4G of memory, minus a section ...
66
votes
15
answers
32k
views
Resources to develop an operating system [closed]
I'm planning to write an operating system and I don't know very much about operating systems. Are there any good resources or books to read in order for me to learn? What are your recommendations?
16
votes
3
answers
9k
views
Protected Mode Keyboard Access on x86 Assembly
I'm working on keyboard input for a very basic kernel that I'm developing and I'm completely stuck. I can't seem to find any information online that can show me the information I need to know.
My ...
12
votes
2
answers
2k
views
Enabling GRUB to automatically boot from the kernel
I am developing a kernel for an operating system. In order to execute it, I've decided to use GRUB. Currently, I have a script attached to GRUB's stage1, stage2, a pad file and the kernel itself ...
10
votes
5
answers
9k
views
The stack size used in kernel development
I'm developing an operating system and rather than programming the kernel, I'm designing the kernel. This operating system is targeted at the x86 architecture and my target is for modern computers. ...
9
votes
7
answers
6k
views
Other than malloc/free does a program need the OS to provide anything else?
I'm working on designing the kernel (which I'm going to actually call the "core" just to be different, but its basically the same) for an OS I'm working on. The specifics of the OS itself are ...
35
votes
13
answers
10k
views
Developing an operating system for the x86 architecture [closed]
I am planning to develop an operating system for the x86 architecture.
What options of programming languages do I have?
What types of compilers are there available, preferably on a Windows environment?...
610
votes
28
answers
129k
views
What are some resources for getting started in operating system development? [closed]
One thing I've always wanted to do is develop my very own operating system (not necessarily fancy like Linux or Windows, but better than a simple boot loader which I've already done).
I'm having a ...