fujidude Posted October 25, 2016 Share Posted October 25, 2016 No, not just drivers. I believe boot code for one, but anyone sufficiently interested can go and look it up. Boot loaders are separate from the OS. The same boot loader can boot multiple operating systems, often even within the same system! But even so, the most popular boot loader used with Linux, GRUB, is also written in C. -*- Text -*- This is the GRUB. Welcome. This file contains instructions for compiling and installing the GRUB. The Requirements ================ GRUB depends on some software packages installed into your system. If you don't have any of them, please obtain and install them before configuring the GRUB. * GCC 4.1.3 or later * GNU Make * GNU Bison 2.3 or later * GNU gettext 0.17 or later * GNU binutils 2.9.1.0.23 or later * Flex 2.5.35 or later * Other standard GNU/Unix tools On GNU/Linux, you also need: * libdevmapper 1.02.34 or later (recommended) To build grub-emu, you need: * ncurses * libusb (recommended) * SDL (recommended) To build GRUB's graphical terminal (gfxterm), you need: * FreeType 2 or later * GNU Unifont If you use a development snapshot or want to hack on GRUB you may need the following. * Python 2.5.2 or later * Autoconf 2.60 or later * Automake 1.10.1 or later * Autogen 5.10 or later Prerequisites for make-check: * qemu, specifically the binary 'qemu-system-i386' Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted October 25, 2016 Share Posted October 25, 2016 I'm not talking about boot loaders, but the boot segment of the kernel. One may also cite parts of the scheduler and who knows what else. But please don't feel obliged to provide evidence to the contrary. If you want there to be no assembly language in the Linux kernel aside from drivers, I'm OK with that. Quote Link to comment Share on other sites More sharing options...
fujidude Posted October 25, 2016 Share Posted October 25, 2016 Yes, I'm guessing there is almost certainly some assembly in there. I stipulate to that. Note though that I never said there wasn't. I suppose in my original post saying to the effect of "even the Linux kernel is written in C" could be construed to mean C and only C. In which case, you were right to point out that there is some assembly in there. But I just meant it that C was used in a significant way; not that it was exclusive And to me at least, that was noteworthy given how OSes once were written in nothing but ML or assembly and, anything else was almost unthinkable. Anyway, I already clarified that some in my next post after that. The reason I was probing you for an example, is because I was hoping to learn something. I'm currently under the impression that these days assembly is only needed for speed/timing or memory/storage constraints (and those conditions are rare anymore). You informed me that's not the case, so I was hoping to learn why that is and what other factor(s) might require the use of assembly over higher level languages. But please, don't feel obligated to provide an example that myself or others might actually learn something from. If you want it that I am proclaiming that there is no assembly in Linux, then I'm OK with that. But I would prefer that others understand that's not really the case, and maybe offer something to learn from. An yes, I've already been doing some digging to do just that but have so far not found what I'm after. Quote Link to comment Share on other sites More sharing options...
_The Doctor__ Posted October 30, 2016 Share Posted October 30, 2016 Funny how, in my experience, all the best C programmers were originally assembly programmers. They seem to be the best at whatever comes their way and are almost always the lead or head of their departments. What are all the high level languages written in, for the most part. Another interesting thing I noticed... almost all of the assembly language programmers get hired by firms using/developing micro controllers. It seems they are better able to write for those specific and embedded chips in the world of electronic wonders that we all carry around and are in everything today. Assembly is forever and higher level languages are the playthings of such programming genius. So many languages have come and gone. C is robust and has been updated so many times. It too has seen the ebb and flow of time and now what other budding in popularity languages are nipping at it's prominence? Quote Link to comment Share on other sites More sharing options...
Kr0tki Posted October 30, 2016 Share Posted October 30, 2016 But even so, the most popular boot loader used with Linux, GRUB, is also written in C. Mostly in C; the kernels for various architectures are written in assembly, of course. Quote Link to comment Share on other sites More sharing options...
fujidude Posted November 3, 2016 Share Posted November 3, 2016 Mostly in C; the kernels for various architectures are written in assembly, of course. I only find evidence of C anymore. Take a look at Linus Torvald's kernel source code. I've been bopping all over in there and all I ever see is .c and fot .h files. And I opened them too just to make sure it wasn't assembly hiding in there; nope, it really is C. I really respect the knowledge and insights of both you and FJC, but all the evidence I can find keeps saying C, C, and more C. Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted November 3, 2016 Share Posted November 3, 2016 Back up the tree and look in the arch folder. Quote Link to comment Share on other sites More sharing options...
fujidude Posted November 4, 2016 Share Posted November 4, 2016 Back up the tree and look in the arch folder. Okay, I did. I still only found C code. I would really appreciate you posting a link to the assembly that you found. I'll just feel more settled if I can see it for myself. Please do not take this to mean that I don't believe you. It's not that at all. It's like a song that you can't get out of your head for me now, and it won't go away until I see it. Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted November 4, 2016 Share Posted November 4, 2016 Just have a poke around. I found it with a few taps on the phone on which I'm typing this. Assembly language files have an ".S" extension. Quote Link to comment Share on other sites More sharing options...
fujidude Posted November 4, 2016 Share Posted November 4, 2016 Finally found some in the Arch folder. Thanks! Quote Link to comment Share on other sites More sharing options...
evilmoo Posted November 5, 2016 Share Posted November 5, 2016 Many C files use asm(" "); syntax where necessary for assembly inclusion, at least in the Linux kernel. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.