Page 1 of 3

Who's right??

Posted: Sun Jun 05, 2005 8:31 am
by ice-o
Hello,

I'm not an expert in the area of OS design - but i'm starting to read up more and more and hopefully i can finish my bootsector soon.
But let me get to the point: I was chatting away on irc in a PHP chanel and then a convo started about bootloaders os's etc. - and i was wandering who was right i : Ice-O or Alix the girl who i was chatting with.

CHAT LOG:

<...>
<alix> why the **** would you use C++
<alix> when you can now compile php code into a binary
<alix> ?
<alix> although granted, PHP isn't nearly as advanced as C/C++ yet
<ice-o> maybe cuzz i want to write an OS
<alix> ...
<alix> obviously you don't know the first thing about writing an OS
<alix> because if you did, you'd know that you could write an OS in PHP
<ice-o> wel i'm working on the bootsector now
<alix> using this roadsend compiler.
<ice-o> yeah right - can u intergrate php and asm then?
<alix> why would you want to?
<ice-o> cuzz u need ASM for inline cmmnds
<alix> seeing as you can now compile PHP into binary form
<alix> ice-o, no, you don't.
<alix> you can create an OS in PHP
<ice-o> yup u do
<alix> no, you do not.
<ice-o> if u write an OS in php u're the first ever to do so
<alix> I doubt it.
<alix> you know, you can use Perl for inline commands
<alix> using the inline perl module, Inline.pm
<alix> you can also write them in C
<alix> you don't need ASM anywhere.
<ice-o> BOOTSECTOR
<ice-o> find me one os written in php
<alix> yep, you could do that with C.
<ice-o> BOOTSECTOR HAS TO BE WRITTEN IN ASM - NOT POSSIBLE IN C++ OR PHP
<alix> no, it doesn't
<alix> it's entirely possible in C or PHP
<ice-o> u can not write a BOOTSECTOR IN C
<... chat then degenerates ...>

---Well people please tell me who is right?--

Greetings,

Ice-o

Re:Who's right??

Posted: Sun Jun 05, 2005 10:55 am
by DennisCGc
"She" is wrong IMO.

1. If PHP is to be compiled, it STILL would be dependent to the target OS' APIs.
2. You simply can't (well, at least I can't) compile a C source within 512 bytes (bin)
3. You can't write to memory regions or any I/O operations (I mean IN and OUT port) with PHP. (so it isn't possible to implement your own screen driver, or a HD driver.
4.
<ice-o> "The canonical example of code that must be written in pure Assembly is the first-stage bootloader."
<ice-o> "It must be written in Assembly, as it requires direct manipulation of certain registers; specifically, the segment selectors and the stack pointer, which would not be possible in C itself."
5. IIRC the bootloader of FreeBSD is written in Assembly, so has Linux, and all the other OSes. (except GRUB, but still uses inline assembly ;) )

And I keep on going like that.

Conclusion: "She" is a newb/morron/whateveryouwanttoreferherthatway.

Re:Who's right??

Posted: Sun Jun 05, 2005 11:22 am
by IRBMe
What an absolute goldmine of quotes.
<alix> C++ sucks
...
<alix> why the f*ck would you use C++
<alix> when you can now compile php code into a binary
I was having a discussion yestarday in fact, which concentrated on this new generation of php 'programmer' kids who think they can code just because they think they know php. You know the "I know php! Therefore I am an amazing programmer and don't need to know any other language ever because php is great" types (for all the real programmers outt here who use php, this is just a minority. I'm not directing this at you). I think this is a great example of one.
<alix> obviously you don't know the first thing about writing an OS
<alix> because if you did, you'd know that you could write an OS in PHP
This one actually made me literally laugh out loud.
<alix> you can create an OS in PHP
This one kept me laughing out loud.
<alix> you know, FreeBSDs bootsector code is all C. no ASM.
<alix> same goes for many other OS'
That's just wrong. The majority of boot loader code can be written in C (see GRUB) but for at least the boot sector, you need pure asm.
<alix> and, there are PLENTY of bootloaders written purely in C. like I already fucking told you, most OS' use C bootloaders
Yes, boot loaders. Not boot sectors. See above point.


So in conclusion, she's probably some kid who thinks she knows everything about programming just because she knows php. She probably doesn't know any other language, and thinks PHP can do everything, despite the fact it's merely a server side scripting language.

In my opinion you should go submit those to the qdb (www.bash.org) for the rest of the world to laugh at, then direct her to this thread.

Re:Who's right??

Posted: Sun Jun 05, 2005 11:25 am
by Candy
The discussion you were having is in a way funny to look at. She holds a certain logic which does hold, but in the other way around.

You can make ANYTHING you can do in PHP in Assembly. You can make ANYTHING you can do in C in Assembly. Dito for ALL other languages, since everything is in the end interpreted to assembly.

You most certainly cannot do the reverse. You cannot do anything you can do in assembly in C.

Compare: All monkeys eat bananas. Are then all bananas eaten by monkeys?

On the reliability of Mega-Tokyo: I more trust a website with over a thousand people on it, more than at least around 40 on it who have in fact done what they talk about and are not afraid to show the code (and publicize and ask for critique) to anybody yelling around an IRC channel.

hi

Posted: Sun Jun 05, 2005 11:34 am
by alix
quite frankly, I find it immeasurably amusing that the kid went and actually made this thread like he threatened to, when I was so obviously deliberately talking out of my @$$ in order to annoy him.

Re:hi

Posted: Sun Jun 05, 2005 11:42 am
by Candy
alix wrote: quite frankly, I find it immeasurably amusing that the kid went and actually made this thread like he threatened to, when I was so obviously deliberately talking out of my @$$ in order to annoy him.
Although it might be funny, if you are not entirely sure of everything (which nobody should be), you should always give some credit to everybody. If somebody claims something with the persistence of all his/her might, who is he to believe she doesn't know anything?

It's never wrong to ask. Even if the entire IRC discussion above is crap, this reply is most certainly wrong of you. There's nothing funny about it.

Re:Who's right??

Posted: Sun Jun 05, 2005 11:43 am
by ice-o
It was no treath!

I was just wandering if there was truth in what she said because i would have been supprised.
This thread was just to find out about if the knowledge i obtain is wrong.

Greetings,

Ice-o

p.s. Thanks Candy!

Re:Who's right??

Posted: Sun Jun 05, 2005 11:45 am
by alix
actually ice-o, you implied on IRC that the entire point of the thread would be to prove me wrong, which is what makes me laugh my @$$ off that you actually went and posted it.

Re:Who's right??

Posted: Sun Jun 05, 2005 11:49 am
by ice-o
Alix are lies is what you come to now.

Ice-o

Re:Who's right??

Posted: Sun Jun 05, 2005 11:50 am
by Candy
Want to know the weirdest stuff? You can make a boot sector (explicitly SECTOR) in C, for the most part. You are going to have a hell of a time coping with compiler shifts and stuff like that and you're required to use a bit of inline assembly, but aside from that you can most certainly make one in C.

If that PHP compiler can do pretty much the same (including inline ASM) then it should, at least in theory, be possible to use that for a boot sector. Won't be nice to look at or logic in most ways, but it would be possible.

You can in the same way make an OS in powerbasic. Would you want to?

Re:Who's right??

Posted: Sun Jun 05, 2005 11:52 am
by ice-o
Oh cool, never knew that it was possible.

And talking about a bootsector in PHP i might believe but an OS??

Ice-o

Re:Who's right??

Posted: Sun Jun 05, 2005 11:52 am
by alix
so, I was talking out of my @$$, yet I was RIGHT? nice.

Re:Who's right??

Posted: Sun Jun 05, 2005 11:56 am
by DennisCGc
IRBMe wrote: What an absolute goldmine of quotes.
Correct :)
I was having a discussion yestarday in fact, which concentrated on this new generation of php 'programmer' kids who think they can code just because they think they know php. You know the "I know php! Therefore I am an amazing programmer and don't need to know any other language ever because php is great" types (for all the real programmers outt here who use php, this is just a minority. I'm not directing this at you). I think this is a great example of one.
You're right, I know one too, he knows PHP so he thinks he's the best in all programming languages.. I'm quite laughing my @$$ off...

Actually, the whole chat log made me laughing my @$$ off..
quite frankly, I find it immeasurably amusing that the kid went and actually made this thread like he threatened to, when I was so obviously deliberately talking out of my @$$ in order to annoy him.
Actually I'm quite amused about how you're reacting now...

And so am I now:
actually ice-o, you implied on IRC that the entire point of the thread would be to prove me wrong, which is what makes me laugh my @$$ off that you actually went and posted it.
Come on, you just can't have it ? You were wrong..

Re:Who's right??

Posted: Sun Jun 05, 2005 12:15 pm
by IRBMe
alix wrote: so, I was talking out of my @$$, yet I was RIGHT? nice.
No you were still talking pretty much rubbish.

Example:
<alix> you know, FreeBSDs bootsector code is all C. no ASM.
<alix> same goes for many other OS'
Boot loaders, yes. Boot sectors, no.

Edit: p.s. let me guess...you use AOL?

Re:Who's right??

Posted: Sun Jun 05, 2005 3:25 pm
by GLneo
If that PHP compiler can do pretty much the same (including inline ASM) then it should, at least in theory, be possible to use that for a boot sector.
but wouldn't the compiler still make a bianary based on an API or make a PE exacutable ???

2.) doesn't the linux bootsecter go though the gcc asm-preprocessor ??? so it has small c things like "#define"

3.) i've got a school full of php "master programers/hax0rs" ;)