What would you like to discuss and learn? Just ask!...
What would you like to discuss and learn? Just ask!...
What would you like to learn? We will discuss and explain it here and in other (sub)topics.
What concepts or operating system project would you like to talk about and break down into its most basic components and explanations?
Anything goes, also open source projects to explain from start to end.
It should feel like a small course that we will develop here in the forum and add resources to it.
What concepts or operating system project would you like to talk about and break down into its most basic components and explanations?
Anything goes, also open source projects to explain from start to end.
It should feel like a small course that we will develop here in the forum and add resources to it.
YouTube:
http://youtube.com/@AltComp126
My x86 OS/software:
https://sourceforge.net/projects/api-simple-completa/
Donate to get more food/programming resources/computers:
https://www.paypal.com/donate/?hosted_b ... QS2YTW3V64
http://youtube.com/@AltComp126
My x86 OS/software:
https://sourceforge.net/projects/api-simple-completa/
Donate to get more food/programming resources/computers:
https://www.paypal.com/donate/?hosted_b ... QS2YTW3V64
Re: What would you like to discuss and learn? Just ask!...
So you are trying to start a forum on a forum? You do know exactly what you are trying to do is why this forum exists. This is like exactly what people are already doing :p Not to burst your bubble tho!
- moondeck
- Member
- Posts: 56
- Joined: Sat Dec 19, 2015 12:18 pm
- Libera.chat IRC: moondeck
- Location: The Zone, Chernobyl
Re: What would you like to discuss and learn? Just ask!...
I dont really understand how memory is allocated after i load my kernel. Say, when i define a variable in my kernels C code, where in memory does it go?
EDIT: Is it in the kernel? say, i call my kmain() from assembly, which is in the .data section of my linker file. Does the C variable reside there? Its not space limited in any way, other than that its its 4K aligned (because i have aligned it). What about variables in assembly? When i defined a GDT, like this
How do i know WHERE it actually points to?
EDIT: Is it in the kernel? say, i call my kmain() from assembly, which is in the .data section of my linker file. Does the C variable reside there? Its not space limited in any way, other than that its its 4K aligned (because i have aligned it). What about variables in assembly? When i defined a GDT, like this
Code: Select all
GDT:
dw something
dd something else
gdt_function:
lgdt[GDT]
My operating system https://github.com/moondeck/hydrogen/
Re: What would you like to discuss and learn? Just ask!...
Well, since you asked . . .
Wi-Fi is one of the least discussed OS development topics. Has anyone here done it? I guess not. So why not? Can't we port the drivers from other OS or even reverse engineer it?
Wi-Fi is one of the least discussed OS development topics. Has anyone here done it? I guess not. So why not? Can't we port the drivers from other OS or even reverse engineer it?
Re: What would you like to discuss and learn? Just ask!...
The bad part about C/C++ developers is they often completely miss the actual processing behind the scene. They think it's cool and smart to use C because it is the preferred language for OS development, it can go low level and the programmer now is as mighty as a god. But C compiler plays a bad joke with the C programmer. It creates an illusion of easiness. So, the programmer just doesn't know where actually his variables are.moondeck wrote:I dont really understand how memory is allocated after i load my kernel. Say, when i define a variable in my kernels C code, where in memory does it go?
I'm far from being C expert but your case is so trivial that even I can tell you that your variables are on the stack unless you have claimed some memory explicitly using something like malloc() or new in C++.
But next I see you are talking about your kernel. And one of the responsibilities of a kernel developer is the memory management. It seems you are relying the job on the compiler instead of thinking about your own memory manager. And the consequence is crying with your own question - leaving something unanswered makes you feel lost with the very simple problems.
I would recommend you to study a bit about kernel's memory management first and the compiler's memory management second. You can start here and next follow the links or ask here if something looks too complex to get it after a few readings.
My previous account (embryo) was accidentally deleted, so I have no chance but to use something new. But may be it was a good lesson about software reliability
Re: What would you like to discuss and learn? Just ask!...
Yes we can. Can you start working on it to help the community? What stops you?Muazzam wrote:Can't we port the drivers from other OS or even reverse engineer it?
Wi-fi has a bit of extra complexity because of the protocols involved and the hardware is nontrivial. I suppose it's essentially more complex than USB. And second problem here is the lack of the unifying standard like is the case for USB. So, if you adopt a driver it doesn't mean everybody can reuse your work, because they should have the same hardware.
To provide some useful information it is required to cover many devices, to find some commonality and to show how different devices extend the common core. Next it is required to cover many protocols involved including such areas as encryption and security as a whole. Only after it all is done it is possible to offer some help to the OS-dev beginners. The only problem here is the time required to do it all.
But may be somebody really has such experience?
My previous account (embryo) was accidentally deleted, so I have no chance but to use something new. But may be it was a good lesson about software reliability
- moondeck
- Member
- Posts: 56
- Joined: Sat Dec 19, 2015 12:18 pm
- Libera.chat IRC: moondeck
- Location: The Zone, Chernobyl
Re: What would you like to discuss and learn? Just ask!...
I dont, i just havent developed the MM for my OS yetembryo2 wrote:moondeck wrote: But next I see you are talking about your kernel. And one of the responsibilities of a kernel developer is the memory management. It seems you are relying the job on the compiler instead of thinking about your own memory manager. And the consequence is crying with your own question - leaving something unanswered makes you feel lost with the very simple problems.
https://github.com/m00nd3ck/hydrogen
My operating system https://github.com/moondeck/hydrogen/
Re: What would you like to discuss and learn? Just ask!...
You need:Muazzam wrote:Wi-Fi is one of the least discussed OS development topics. Has anyone here done it? I guess not. So why not?
- a working kernel, memory management and all;
- a working network stack.
As embryo2 pointed out, no unifying standards. You would be writing one WiFi driver, for a specific chipset, for one specific OS. All other OS / chipset combinations would still not work.Can't we port the drivers from other OS or even reverse engineer it?
As for porting a driver... you would need one that is Open Source to begin with. If you're looking at Linux, their drivers reside in kernel space. This means 1) lots of dependencies on the rest of the kernel, not much use to non-Linux kernels which would have to implement a more-or-less complete compatibility layer; 2) intentionally fluctuating kernel / driver API, i.e. future updates to upstream driver code may well imply significant changes to that compatibility layer, and last but not least, 3) GPL...
Every good solution is obvious once you've found it.
Re: What would you like to discuss and learn? Just ask!...
To access asm variables and functions from linked c:moondeck wrote:I dont really understand how memory is allocated after i load my kernel. Say, when i define a variable in my kernels C code, where in memory does it go?
EDIT: Is it in the kernel? say, i call my kmain() from assembly, which is in the .data section of my linker file. Does the C variable reside there? Its not space limited in any way, other than that its its 4K aligned (because i have aligned it). What about variables in assembly? When i defined a GDT, like this ...
How do i know WHERE it actually points to?
gcc examples (gcc does not mangle names)
Code: Select all
.global x
x: .long 1
.global asm_function
asm_function:
mov eax, -1
ret
other_asm_function:
mov eax, [C_variable]
mov [x], eax
push eax
call other_C_function
ret
Code: Select all
extern int x; /* tell linker that the variable is external */
int asm_function(void); /* protoype the asm function */
int C_variable; /* global variable */
int C_function(void){
if (x){ /* access the asm variable */
return asm_function; /* invoke the asm function */
}
}
int other_C_function(int var){
return 2 * var;
}
Code: Select all
int (*function)(int) = (void *)0x100000;
function(0);
Code: Select all
#define function ((int(*)(int)) ((void *)(*(unsigned long *)0x10000)))
function(0);
Re: What would you like to discuss and learn? Just ask!...
What stops me, to be honest, is my experience. Also, my OS is in assembly without POSIX standards. There are many guys here with very advanced Unix-like operating systems, so it'd be a lot easier for them to follow the driver's source code if they want to write their own.embryo2 wrote:Yes we can. Can you start working on it to help the community? What stops you?Muazzam wrote:Can't we port the drivers from other OS or even reverse engineer it?
I think, they Wi-Fi is not in their priorities. Maybe, my hobby OS would become famous if managed to write a driver for Wi-Fi?
Re: What would you like to discuss and learn? Just ask!...
This is not always true. Global variables reside in statically allocated sections.variables are on the stack unless you have claimed some memory explicitly using something like malloc() or new in C++.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay
- Alan Kay
Re: What would you like to discuss and learn? Just ask!...
So, are you expecting someone else to describe you what to do? But have you read about the wi-fi problems? It means you have a small chance of meeting somebody with open source wi-fi code and ready to tell you about it. And if there's somebody, who managed to write a driver for wi-fi, then how can you become famous?Muazzam wrote:What stops me, to be honest, is my experience.
...
Maybe, my hobby OS would become famous if managed to write a driver for Wi-Fi?
May be in your situation it is better to ask about Linux kernel driver development. Next you can get the Linux sources and try to understand how a particular wi-fi driver works (or even better to start with something much simpler). And then you'll be able to port the driver to your OS. Of course, you should pay attention to the availability of an open source wi-fi driver for your hardware.
Are you scared about the efforts required?
My previous account (embryo) was accidentally deleted, so I have no chance but to use something new. But may be it was a good lesson about software reliability
Re: What would you like to discuss and learn? Just ask!...
May be, I'm Java fan.Roman wrote:This is not always true. Global variables reside in statically allocated sections.variables are on the stack unless you have claimed some memory explicitly using something like malloc() or new in C++.
My previous account (embryo) was accidentally deleted, so I have no chance but to use something new. But may be it was a good lesson about software reliability
Re: What would you like to discuss and learn? Just ask!...
A choice which makes it an order of magnitude less likely that you will write a Wi-Fi driver.Muazzam wrote:Also, my OS is in assembly without POSIX standards.
I'm sure that you have good reasons for wanting to write your OS in assembly (actually, that's a lie; I'm pretty sure that you don't have a good reason for this choice) but you have to appreciate the extra difficulties that this choice involves.
- BrightLight
- Member
- Posts: 901
- Joined: Sat Dec 27, 2014 9:11 am
- Location: Maadi, Cairo, Egypt
- Contact:
Re: What would you like to discuss and learn? Just ask!...
Lately, I'm into AHCI and networking.
I'm building an AHCI driver based on the info on the Wiki, but there seems to be quite little networking info.
I'm building an AHCI driver based on the info on the Wiki, but there seems to be quite little networking info.
You know your OS is advanced when you stop using the Intel programming guide as a reference.