On Jan 4, 5:34 am, Bhaktavatsalam Nallanthighal <[email protected]> wrote: > Hello, > > Can anyone explain in a clear way, how linux deals with > portability across architectures. The main points I'm getting confused > are: > > - Does a single linux kernel support processors of varying size? I > mean, will the same linux kernel give me the ability to compile it for > various sized processors[8-bit, 16-bit, 32-bit, 64-bit]?
Yes, linux kernel supports different processors. Although I am not sure if it supports an 8 bit one, as linux was first made for 80386 microprocessor. If you configure and compile the kernel yourself, you'll see that there are options that allow you to compile it for different processors. These options are nothing but conditional compilation statements like #ifdef in the kernel code, so, according to the processor you select, the coressponding code for that very processor is compiled. > If so, how > does it deal with the datatypes consistently? There is definition for different datatypes and again conditional compilation is used for the same. If you go through the kernel code you'll see that there are various directories for different architectures. e.g. for x86 machines, you'll find the code in arch/ x86/. > And how does it provide > a unified layer to applications that use processor specific > functionality? System Calls, and the library functions help you do that. >Also, how does it manupilate datatypes that the > processor does not inherently support. For example, if I am able to > compile for a 16-bit processor, how does it support the uint32 > datatype used in other areas of the kernel [addition, subtraction, > byte ordering]? I guess gcc does that for you. Please let me know if I am wrong here. > > - Does the Linux kernel implement "Protected Mode" and other kinds > of features also in other architectures that do not support them? > If so, how? If not, how is it made possible that one feature is present > in one compilation and is not present in another? How does this effect > the other areas of the kernel that depend on this features No it doesn't on other processors. And once again conditional compilation is used for that. > > Thanks in advance. If possible please send me your replies to > [email protected]. The digests I get fill my inbox! > > Bhaktavatsalam Nallanthighal Also, if you've already not done it, configure and compile the kernel yourself, you'll know how things actually work. Also read the kernel sources. If you're interested to know about the Linux kernel a great place to start is http://kernelnewbies.org/ . -- You received this message because you are subscribed to the Linux Users Group. To post a message, send email to [email protected] To unsubscribe, send email to [email protected] For more options, visit our group at http://groups.google.com/group/linuxusersgroup
