Skip to contentSkip to conversation

Rewrite Kernel

DISCUSSION Mohamed Aslan 25 participants 32 messages Apr 7, 2004 – Apr 13, 2004

lore
Share & tools
lore
#0 lore raw

i wanna to rewrite a version of linux kernel from scratch in assembly for intel 386+ fo speed and a libc also in assembly for speed what do u think guys

Signature · 6 lines
______________________________________________
Check out the latest SMS services @ http://www.linuxmail.org 
This allows you to send and receive SMS through your mailbox.


Powered by Outblaze
#1 lore raw
Quoted 2 lines · Mohamed Aslan

i wanna to rewrite a version of linux kernel from scratch in assembly for intel 386+ fo speed and a libc also in assembly for speed what do u think guys

That you are utterly unoriginal wanker, what else?

#2 lore raw
In reply to Mohamed Aslan
Quoted 3 lines · Previously Mohamed Aslan

i wanna to rewrite a version of linux kernel from scratch in assembly for intel 386+ fo speed and a libc also in assembly for speed what do u think guys

Great idea. By the time you'll be done you will realize that 40 years have passed, 386 has been obsolete for a few decades and the end result is not really that much faster.

Wichert.

Signature · 2 lines
Wichert Akkerman <[email protected]>    It is simple to make things.
http://www.wiggy.net/                   It is hard to make things simple.
#3 lore raw
In reply to Mohamed Aslan

Quote from "Mohamed Aslan" <[email protected]>:

Quoted 2 lines

i wanna to rewrite a version of linux kernel from scratch in assembly for intel 386+ fo speed and a libc also in assembly for speed what do u think guys

Don't bother. Spending the time doing something else would almost certainly be more productive overall.

IFF you are skilled enough to seriously contemplate doing it, why not start thinking about a completely new operating system design instead? There is a lot which I don't think will ever be done with GNU/Linux - why not plan for the day we throw it all away and start again?

John.

#4 lore raw
In reply to Mohamed Aslan
Quoted 2 lines · Mohamed Aslan

i wanna to rewrite a version of linux kernel from scratch in assembly for intel 386+ fo speed and a libc also in assembly for speed what do u think guys

Why not just write a program to translate 'C' code into assembly?

#5 lore raw
Quoted 1 line · Sean Neakums

Why not just write a program to translate 'C' code into assembly?

You mean like a .... compiler ? :)

Signature · 1 line
Cioby
#6 lore raw
In reply to Sean Neakums
Quoted 7 lines · Sean Neakums
Quoted 2 lines · Mohamed Aslan

i wanna to rewrite a version of linux kernel from scratch in assembly for intel 386+ fo speed and a libc also in assembly for speed what do u think guys

Why not just write a program to translate 'C' code into assembly?

It's called a compiler and we already have several versions, none optimum.

Cheers,
Dick Johnson
Penguin : Linux version 2.4.24 on an i686 machine (797.90 BogoMips).
Note 96.31% of all statistics are fiction.

#7 lore raw
Quoted 9 lines · Richard B. Johnson
Quoted 6 lines · Sean Neakums
Quoted 2 lines · Mohamed Aslan

i wanna to rewrite a version of linux kernel from scratch in assembly for intel 386+ fo speed and a libc also in assembly for speed what do u think guys

Quoted 7 lines
Quoted 2 lines

Why not just write a program to translate 'C' code into assembly?

It's called a compiler and we already have several versions, none optimum.

Compilers probably will never be optimum. One has to choose either to live with that or start "rewriting the kernel from scratch for intel 386+" and so forth.

We all know what is appropriate on this list, so can the interested parties - not me - please take this thread off this list?

(directed at nobody in particular)

Thanks

#8 lore raw
In reply to Richard B. Johnson
Quoted 2 lines · Richard B. Johnson

It's called a compiler and we already have several versions, none optimum.

However, I do believe that all the currently supported compilers are able to beat out any programmers over the long run - we can use asm tricks to hand-tune very small sections of hot-spot code, but nobody can sustain that level of hand-optimization for 10K or 20K lines of code.

Anybody thinking of this is almost surely better off spending their time coming up with new and better algorithms.

#9 lore raw
In reply to Mohamed Aslan
Quoted 2 lines · Mohamed Aslan

i wanna to rewrite a version of linux kernel from scratch in assembly for intel 386+ fo speed and a libc also in assembly for speed what do u think guys

You're 6 days late, nice try though.

#10 lore raw
In reply to Mohamed Aslan
Quoted 4 lines · Mohamed Aslan

i wanna to rewrite a version of linux kernel from scratch in assembly for intel 386+ fo speed and a libc also in assembly for speed what do u think guys
--

I have a version of libc that has a lot of code written in assembly. All of the Linux interface, all the string stuff, etc. You can have a copy, if you want. That is a start.

This will be a big project. There's a lot more to the Linux kernel than just creating some I/O capability. Linux has to emulate Unix so it's a lot more work than rolling your own 32-bit OS with a file-system.

Cheers,
Dick Johnson
Penguin : Linux version 2.4.24 on an i686 machine (797.90 BogoMips).
Note 96.31% of all statistics are fiction.

#11 lore raw
In reply to Mohamed Aslan
Quoted 2 lines · Mohamed Aslan

i wanna to rewrite a version of linux kernel from scratch in assembly for intel 386+ fo speed and a libc also in assembly for speed what do u think guys

That you should read the FAQ: http://www.tux.org/lkml/#s15-2

Erik

Signature · 2 lines
+-- Erik Mouw -- www.harddisk-recovery.com -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands
#12 lore raw
In reply to Mohamed Aslan

Hi Mohamed,

I am not sure if your intentions are real, but I am assuming they are.

Writing the linux kernel all in assembler would be almost impossible, it has taken 10 years to get the kernel to the point it is in C, going that all in ASM would be a) pointless and b) time consuming, your work would be outdated before its done

Also, the technical know-how for such a task would be large, the kernel is a collection of the knowledge, intelligence and time of hundreds of people, I do not beleive one person could know or hold or the know how for that (while some who do alot of hacking, linus, alan cox, etc may know *alot*, i still don't beleive even they could do such a task)

However, if you are serious about something like this and have the knowhow, time and will, you have a few options.

a) You could hack the kernel in C, including optimizing what is there, making better algorithms of systems for doing things
b) You could convert some parts of the kernel to ASM for the i386 arch specific stuff, if it can be as functional and have a usefull gain.
c) You could work on the GCC compiler for generating better assembly code from the C output, I'm sure there are many areas this could be improved.
d) You could work on libc, in a similar fassion to the above, optimizing, fixing, improving and adding to it.

Best of luck with your adventures.

Cheers,
Trent
Bur.st

Quoted 2 lines

i wanna to rewrite a version of linux kernel from scratch in assembly for intel 386+ fo speed and a libc also in assembly for speed what do u think guys

--
Trent "Lathiat" Lloyd <[email protected]>

Sixlabs.org (http://www.sixlabs.org/)
Bur.st Networking Inc. (http://www.bur.st/)

#13 lore raw
In reply to Mohamed Aslan
Quoted 2 lines · Mohamed Aslan

i wanna to rewrite a version of linux kernel from scratch in assembly for intel 386+ fo speed and a libc also in assembly for speed what do u think guys

this would be insanity. i would rather look at optimizing some of the code from the kernel.

or, as mentioned before, write a new OS.
all OS:s today has some problems, and unix isnt ideal. neither is the other ones, like windows or macos, which is based on BSD.

i believe that a team of coders, on full time to on some years, create a new operating system, that could easily compete with unix's and windows. but, ofcourse, this would require all development to stop on linux(if the linux developers should do it).
and that isnt possible. so therefore development goes on to just do the best thing possible with what we got today.

Signature · 2 lines
Regards, Redeeman
[email protected]
#14 lore raw
Quoted 4 lines

but, ofcourse, this would require all development to stop on linux(if the linux developers should do it).
and that isnt possible. so therefore development goes on to just do the best thing possible with what we got today.

Not really - there are free, open source OS projects other than Linux in fairly advanced stages technically, (I.E. they do more than just boot, and can run real applications).

However, to take my attention away from Linux, an OS project would probably have to be fairly revolutionary, and represent something that I honestly believed could not ever be practically achieved with the Linux model.

The only obstacle that I can see to creating something better than the Linux kernel, is that nobody is doing it yet.

John.

#15 lore raw

Guys, gals,

you are all missing the point.

It is obvious that what we really need is a hand-optimized in-kernel core LISP machine written in >i386 assembly, then we need to port the rest of the kernel to run as LISP bytecode on top of that in ring1 (in particular the security policies).

Of course, important privileged user-space such as glibc should be ported to this highly efficient non-recursive LISP machine too for efficiency and run on ring 2 for speed and security.

As a further benefit, this could provide us with a stable kernel binary ABI via the LISP interfaces to which we could dynamically translate the existing kernel modules on load, for which nvidia and the binary-only Inifiband stack seem perfect candidates to secure industry buyin.

Oh, and of course this project needs to be managed via BitKeeper.

Sincerely,
Lars Marowsky-Brée <[email protected]>

Signature · 3 lines
High Availability & Clustering	      \ ever tried. ever failed. no matter.
SUSE Labs			      | try again. fail again. fail better.
Research & Development, SUSE LINUX AG \ 	-- Samuel Beckett
#16 lore raw
Quoted 8 lines

It is obvious that what we really need is a hand-optimized in-kernel core LISP machine written in >i386 assembly, then we need to port the rest of the kernel to run as LISP bytecode on top of that in ring1 (in particular the security policies).

Of course, important privileged user-space such as glibc should be ported to this highly efficient non-recursive LISP machine too for efficiency and run on ring 2 for speed and security.

Errr, no, I don't think so :-).

John.

#17 lore raw
In reply to Lars Marowsky-Bree
Quoted 4 lines

It is obvious that what we really need is a hand-optimized in-kernel core LISP machine written in >i386 assembly, then we need to port the rest of the kernel to run as LISP bytecode on top of that in ring1 (in particular the security policies).

..or just pass init=/bin/emacs to your bootloader :-).

John.

#19 lore raw
In reply to Lars Marowsky-Bree
Quoted 9 lines · Lars Marowsky-Bree

Guys, gals,

you are all missing the point.

It is obvious that what we really need is a hand-optimized in-kernel core LISP machine written in >i386 assembly, then we need to port the rest of the kernel to run as LISP bytecode on top of that in ring1 (in particular the security policies).

Quoted 8 lines

Of course, important privileged user-space such as glibc should be ported to this highly efficient non-recursive LISP machine too for efficiency and run on ring 2 for speed and security.

As a further benefit, this could provide us with a stable kernel binary ABI via the LISP interfaces to which we could dynamically translate the existing kernel modules on load, for which nvidia and the binary-only Inifiband stack seem perfect candidates to secure industry buyin.

this is a good idea, but i doubt that anyone would dare to do that :D

Quoted 6 lines

Oh, and of course this project needs to be managed via BitKeeper.

Sincerely,
Lars Marowsky-Brée <[email protected]>

Signature · 2 lines
Regards, Redeeman
[email protected]
#20 lore raw

It is getting really tough to distinguish sarcasm from real comments on this thread :)

(if there is such a thing as "real comments" to a proposal like this)

Signature · 2 lines
Paulo Marques - www.grupopie.com
"In a world without walls and fences who needs windows and gates?"
#21 lore raw
In reply to Lars Marowsky-Bree
Quoted 4 lines · Lars Marowsky-Bree

Guys, gals,

you are all missing the point.

Quoted 10 lines

It is obvious that what we really need is a hand-optimized in-kernel core LISP machine written in >i386 assembly, then we need to port the rest of the kernel to run as LISP bytecode on top of that in ring1 (in particular the security policies).

Of course, important privileged user-space such as glibc should be ported to this highly efficient non-recursive LISP machine too for efficiency and run on ring 2 for speed and security.

What you are talking about is a LISP machine micro-kernel in Ring0 which sort of defeats the whole point of Linux being monolithic kernel. Also couldn't we just run HURD, or for that matter EMACS ;-), as a kernel. I, personally have come around to Linus point of view on the whole micro-kernel thing so I don't see much of a advantage to this, as there are other micro kernel projects ( HURD, Darwin/*BSD?).

-Aaron

#22 lore raw
Quoted 11 lines · Aaron Smith
Quoted 9 lines · Lars Marowsky-Bree

Guys, gals,

you are all missing the point.

It is obvious that what we really need is a hand-optimized in-kernel core LISP machine written in >i386 assembly, then we need to port the rest of the kernel to run as LISP bytecode on top of that in ring1 (in particular the security policies).

Quoted 8 lines
Quoted 5 lines

Of course, important privileged user-space such as glibc should be ported to this highly efficient non-recursive LISP machine too for efficiency and run on ring 2 for speed and security.

What you are talking about is a LISP machine micro-kernel in Ring0 which sort of defeats the whole point of Linux being monolithic kernel. Also couldn't we just run HURD, or for that matter EMACS ;-),

Yes, I use Emacs as my operating system. It uses Linux as a device driver.

Signature · 2 lines
Måns Rullgård
[email protected]
#23 lore raw

Will you please use a more modern programming language such as Autocoder or maybe COBOL.

There have already been several operating systems written in Assembly.

They are also rather large in terms of LOC.

Cheers,
Dave

PS:Sorry I couldn't resist ;) , late night little sleep :( , plenty of beer:).

#24 lore raw
Quoted 5 lines · David B. Stevens

Will you please use a more modern programming language such as Autocoder or maybe COBOL.

There have already been several operating systems written in Assembly.

Quoted 7 lines

They are also rather large in terms of LOC.

Cheers,
Dave

PS:Sorry I couldn't resist ;) , late night little sleep :( , plenty of beer:).

I suggest n*Funge.

Regards: David Weinehall

Signature · 3 lines
 /) David Weinehall <[email protected]> /) Northern lights wander      (\
//  Maintainer of the v2.0 kernel   //  Dance across the winter sky //
\)  http://www.acc.umu.se/~tao/    (/   Full colour fire           (/
#25 lore raw
In reply to Mohamed Aslan
Quoted 3 lines · you

i wanna to rewrite a version of linux kernel from scratch in assembly for intel 386+ fo speed and a libc also in assembly for speed what do u think guys

maybe you'd have fun with the LinuxBIOS crowd
www.linuxbios.org

Signature · 1 line
Rob Couto [[email protected]]
#26 lore raw
Quoted 7 lines · Rob Couto
Quoted 3 lines · you

i wanna to rewrite a version of linux kernel from scratch in assembly for intel 386+ fo speed and a libc also in assembly for speed what do u think guys

maybe you'd have fun with the LinuxBIOS crowd
www.linuxbios.org

Likely just the opposite. We have written a C compiler that does not implicitly use memory. Having had to reinvent the wheel a feel times because of where we are working, it is clear that tools are your friend.

There is no shame in rewriting something when what exists does not work for you and it matters. If your rewrite happens to be significantly faster than the broken version that is just a plus. :)

Eric

#28 lore raw
In reply to Mohamed Aslan
Quoted 4 lines · Mohamed Aslan

i wanna to rewrite a version of linux kernel from scratch in assembly for intel 386+ fo speed and a libc also in assembly for speed what do u think guys

I doubt you would be capable of generating assembly that would be any faster than gcc, and you would inherit all the accidental difficulties that come with engineering software at a lower-level.

-ryan

#29 lore raw
Quoted 8 lines · J. Ryan Earl
Quoted 3 lines · Mohamed Aslan

i wanna to rewrite a version of linux kernel from scratch in assembly for intel 386+ fo speed and a libc also in assembly for speed what do u think guys

I doubt you would be capable of generating assembly that would be any faster than gcc, and you would inherit all the accidental difficulties that come with engineering software at a lower-level.

No, writing 'better than gcc' assembly is easy, gcc is far from stellar in this regard. But it's painfully slow and non-portable.
--
vda

#30 lore raw
Quoted 10 lines · Denis Vlasenko
Quoted 5 lines

I doubt you would be capable of generating assembly that would be any faster than gcc, and you would inherit all the accidental difficulties that come with engineering software at a lower-level.

No, writing 'better than gcc' assembly is easy, gcc is far from stellar in this regard. But it's painfully slow and non-portable.

How can "painfully slow and non-portable" be better? You mean faster?

Doesn't change the fact that I doubt he could write faster assembly. By the time he got done doing it in assembly, gcc 5 would probably be out generating much faster binaries, not to mention new major stable kernel revisions.

#31 lore raw
Quoted 9 lines · J. Ryan Earl
Quoted 6 lines · Denis Vlasenko
Quoted 3 lines

I doubt you would be capable of generating assembly that would be any faster than gcc, and you would inherit all the accidental difficulties that come with engineering software at a lower-level.

No, writing 'better than gcc' assembly is easy, gcc is far from stellar in this regard. But it's painfully slow and non-portable.

How can "painfully slow and non-portable" be better? You mean faster?

*writing* asm code is painfully slow and code is not portable. That's why no sane person will write kernel in asm. --
vda