Re: [9fans] s3venti

2008-02-10 Thread Skip Tavakkolian
that's interesting. we initially considered that, but decided on
S3fs. , brucee has been working on it. we will use it to provide
archiving for rangboom users.

> I mentioned in passing some time ago that I was working on a venti
> server that uses Amazon S3 as a storage backend. There is now code in
> /n/sources/contrib/rcbilson/s3venti . Beware sharp edges. I have
> pumped a fair amount of test data through it successfully, but I
> wouldn't recommend trusting anything important to it yet. There is a
> man page.
> 
> I started writing it under plan9, but for irrelevant reasons later
> switched to plan9port, so that's where it's known to work (on Linux,
> at least). I would hope and expect that moving it back to native plan9
> would be a small job.
> 
> Questions and comments are welcome.



Re: [9fans] Hello Assembly

2008-02-10 Thread maht

Windows 1, 2 &3 was done in assembler


[9fans] s3venti

2008-02-10 Thread Richard Bilson
I mentioned in passing some time ago that I was working on a venti
server that uses Amazon S3 as a storage backend. There is now code in
/n/sources/contrib/rcbilson/s3venti . Beware sharp edges. I have
pumped a fair amount of test data through it successfully, but I
wouldn't recommend trusting anything important to it yet. There is a
man page.

I started writing it under plan9, but for irrelevant reasons later
switched to plan9port, so that's where it's known to work (on Linux,
at least). I would hope and expect that moving it back to native plan9
would be a small job.

Questions and comments are welcome.


Re: [9fans] Hello Assembly

2008-02-10 Thread erik quanstrom
> One more thing. Does anyone know if, in raw x86 assembly, RET implies  
> STI? Thanks.

if it did, it would be impossible to call a function with interrupts off.

- erik


Re: [9fans] Hello Assembly

2008-02-10 Thread Pietro Gagliardi
One more thing. Does anyone know if, in raw x86 assembly, RET implies  
STI? Thanks.




Re: [9fans] Hello Assembly

2008-02-10 Thread Pietro Gagliardi
Oh, and I can't wait to see those two have GUI support. When I finish  
making my OS C- and portability-friendly, I'm going to start with  
graphics.


On Feb 10, 2008, at 9:36 PM, Adrian Tritschler wrote:


Anant Narayanan <[EMAIL PROTECTED]> writes:


I am working on rewriting an operating system that avoids this
philosophy for the purpose of teaching assembly language. So far, I
have 2% of the code (I started a rewrite), and I don't know if my
code is 100% right.


There's an OS (complete with a Window Manager, IDE, Web Browser, and
even some games) written entirely in assembly: http:// 
www.menuetos.net/


Or, if you want something at the other end of the spectrum, there's an
OS "with modular microkernels using the C# programming language."

http://arstechnica.com/news.ars/post/20080208-developers-create- 
open-source-os-kernels-using-net-tools.html



Everyone has 24 hours in a day, but some use it more than others ;)


Indeed


Anant

  Adrian




Re: [9fans] Hello Assembly

2008-02-10 Thread Pietro Gagliardi

On Feb 10, 2008, at 9:36 PM, Adrian Tritschler wrote:


OS "with modular microkernels using the C# programming language."


Microsoft has too, and it outdates the other two. Unfortunately, it's  
only available in Microsoft and a select few universities.


http://research.microsoft.com/os/singularity/



Re: [9fans] Hello Assembly

2008-02-10 Thread Adrian Tritschler
Anant Narayanan <[EMAIL PROTECTED]> writes:

>> I am working on rewriting an operating system that avoids this
>> philosophy for the purpose of teaching assembly language. So far, I
>> have 2% of the code (I started a rewrite), and I don't know if my
>> code is 100% right.
>
> There's an OS (complete with a Window Manager, IDE, Web Browser, and
>even some games) written entirely in assembly: http://www.menuetos.net/

Or, if you want something at the other end of the spectrum, there's an
OS "with modular microkernels using the C# programming language."

http://arstechnica.com/news.ars/post/20080208-developers-create-open-source-os-kernels-using-net-tools.html

> Everyone has 24 hours in a day, but some use it more than others ;)

Indeed

> Anant
  Adrian


Re: [9fans] How to move to rc from sh/bash

2008-02-10 Thread Martin Neubauer
* Pietro Gagliardi ([EMAIL PROTECTED]) wrote:
> - The seq statement is standard
>   for (i in `{seq 1 10}) echo $i

Nope, seq is an external program (subject to the environment). On the other
hand, as Byron's rc is rather extinct by now, chances are if rc is available,
so is seq.

> - aux/getflags is faster than while getopt (no loop involved)
>   My next plan is to rewrite all of /rc/bin to use aux/getflags. Any  
> objections?

Well, that isn't so much about rc's advantages. Keep in mind though that
this would force getflags to be present whenever you need a shell script.
For most installations this isn't an issue, but for those running Plan 9
embedded it is. And with space constraints providing some of /rc/bin might
be reasonable, providing aux/getflags might not. Besides, if a script
doesn't use more than two or three different options getflags doesn't reduce
much complexity (if you aren't writing a new script). And concerning speed,
if command line parsing dominates the execution time I honestly wouldn't
bother.

> And what I dislike:
> - >[2=] is not the same as >[2]/dev/null (some programs crash with  
> the former

I don't think it should be the same. Both are special cases for two
different operations.

But what's really great about rc:
% man bash | wc -l
4898
% man rc | wc -l
 398
If I'd want to check the bash man page for some specific information,
chances are that I'm sound asleep before anything interesting comes up.

Martin



Re: [9fans] Hello Assembly

2008-02-10 Thread Pietro Gagliardi

In C, it could look like

Write(char *filename, void *data, uvlong number_of_bytes);

so I don't think it has an Open syscall, or probably you read  
everything into memory, modify the memory, then write it back. 64-bit  
systems can store quite a bit, but this philosophy will get old  
almost immediately:


	$ sed2c '1s/^/@/' # given sed2c is a program that converts sed  
commands to C

char *buffer;
buffer = malloc(FileLen("f"));
Read("f", buffer, FileLen("f"));
b[0] = '@';
Write("f", buffer, strlen(buffer));

Does that seem like a bit much?

On Feb 10, 2008, at 1:01 PM, erik quanstrom wrote:


There's an OS (complete with a Window Manager, IDE, Web Browser, and
even some games) written entirely in assembly: http:// 
www.menuetos.net/


Everyone has 24 hours in a day, but some use it more than others ;)



i can see from their documentation, that i have been using my time  
quite

a bit more effectively:

"Menuet has no roots within UNIX or the POSIX standards,
nor is it based on any particular operating system. The design
goal has been to remove the extra layers between different parts
of an OS, which normally complicate programming and create bugs.

here's their write system call:

  rbx - 1 Write

rcx - Ignored
rdx - Bytes to save
rex - Pointer to data
rfx - Filename pointer

!?

- erik




Re: [9fans] Hello Assembly

2008-02-10 Thread erik quanstrom
> There's an OS (complete with a Window Manager, IDE, Web Browser, and  
> even some games) written entirely in assembly: http://www.menuetos.net/
> 
> Everyone has 24 hours in a day, but some use it more than others ;)
> 

i can see from their documentation, that i have been using my time quite
a bit more effectively:

"Menuet has no roots within UNIX or the POSIX standards,
nor is it based on any particular operating system. The design
goal has been to remove the extra layers between different parts
of an OS, which normally complicate programming and create bugs.

here's their write system call:

  rbx - 1 Write

rcx - Ignored
rdx - Bytes to save
rex - Pointer to data
rfx - Filename pointer

!?

- erik


Re: [9fans] How to move to rc from sh/bash

2008-02-10 Thread erik quanstrom
> It produces the string ' bla$e''o' in rc syntax. The one thing I like  
> about two quoting styles  in the Bourne shell is that I can use  

it's not so much the number of quotes (there are three, by the way),
it's the complex rules.  for example:

; /bin/bash
$ x=1
$ echo "$x"
1
$ echo '$x'
$x
$ echo `echo "\$x"`
1   <- reparsing rule.
$ echo "'$x'"
'1'
$ echo "'\$x'"
'$x'
but
$ echo `echo 
> The proper is
> 
> if [ $bla -eq $otherbla ]; then
>   :
> fi
> 
> The advantage of rc is that that : is not necessary!
> 
> Oh, and let's not forget what happens when bla or otherbla is nil! In  
> rc,
>   if (~ $bla $otherbla) { }
> is all that is needed - no hooks.

that's actually a problem.  while ~ is nice, it only does shell matching.
what if you want regexp matching or test (aka on unix [) operators?
then you have exactly the same problem with missing variables.

> And what I dislike:
> - >[2=] is not the same as >[2]/dev/null (some programs crash with  
> the former

this isn't a shell issue.  >[2=] closes fd 2.  it's not clear to me that
arbitrary plan 9 programs are expected to run without one of the
three fds they've been promised by convention.

- erik


Re: [9fans] How to move to rc from sh/bash

2008-02-10 Thread Pietro Gagliardi

On Feb 10, 2008, at 11:59 AM, Gorka Guardiola wrote:


On Feb 9, 2008 8:53 AM, Hongzheng Wang <[EMAIL PROTECTED]> wrote:

Hi all,

2. In non-interactive use (script programming), what's the main
advantages of rc over sh/bash?


Things I like of rc:

In both interactive and non-interactive, spaces do not bite you in rc.

in bash

if [ $bla -eq $otherbla ] ; fi endif... ahhh, I can´t remember the
syntax and get the spaces wrong,


The proper is

if [ $bla -eq $otherbla ]; then
:
fi

The advantage of rc is that that : is not necessary!

Oh, and let's not forget what happens when bla or otherbla is nil! In  
rc,

if (~ $bla $otherbla) { }
is all that is needed - no hooks.


Someone else said it, only one quoting simbol
(what does " bla \$e'o" do on bash?, I just invented it, but every  
time I see

double qoutes I start trembling)


It produces the string ' bla$e''o' in rc syntax. The one thing I like  
about two quoting styles  in the Bourne shell is that I can use  
escape sequences. The one thing I dislike about bash is that bash  
fucks up this quote system.




And here is my 2 cents:

- List objects are STANDARD (bash/kornshell arrays are not)
x=(a b c)
- The seq statement is standard
for (i in `{seq 1 10}) echo $i
- Removable functions
fn x { echo 4 }
fn x
x=4
- >[] piping syntax is much more intuitive
- |[2] to pipe arbitrary file descriptors. One time, to skim through  
errors from gcc to find out if I had mistyped a member of a struct, I  
had to do

gcc a_file_in_my_os.c 2>&1 | grep member
  In rc:
8c a_file_in_my_os.c |[2] grep member
- Empty condition bodies! while(){echo y} is the yes command. It's  
much more terse.

- aux/getflags is faster than while getopt (no loop involved)
	My next plan is to rewrite all of /rc/bin to use aux/getflags. Any  
objections?
- The trap statement is gone - goodbye confusing hooks and no way of  
telling signal 1 from a command/function called 1

Instead, you define functions sigterm and sigkill (I think)

And what I dislike:
- >[2=] is not the same as >[2]/dev/null (some programs crash with  
the former




Re: [9fans] How to move to rc from sh/bash

2008-02-10 Thread Gorka Guardiola
On Feb 9, 2008 8:53 AM, Hongzheng Wang <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> 2. In non-interactive use (script programming), what's the main
> advantages of rc over sh/bash?

Things I like of rc:

In both interactive and non-interactive, spaces do not bite you in rc.

in bash

if [ $bla -eq $otherbla ] ; fi endif... ahhh, I can´t remember the
syntax and get the spaces wrong,
never know if I need endif or fi or...

if ( command ) {
}

I don´t need to remember spaces, or contrived grammar.

Also the operator ^ and the fact that it is distributive is really powerful.
Someone else said it, only one quoting simbol
(what does " bla \$e'o" do on bash?, I just invented it, but every time I see
double qoutes I start trembling)

The most important thing is that it is *simple*, it doesn´t have any feature
someone may have thought a shell may need because they didn´t know how
to use sed. It only has a well thought subset of complete features.
-- 
- curiosity sKilled the cat


Re: [9fans] Hello Assembly

2008-02-10 Thread Anant Narayanan
I am working on rewriting an operating system that avoids this  
philosophy for the purpose of teaching assembly language. So far, I  
have 2% of the code (I started a rewrite), and I don't know if my  
code is 100% right.


There's an OS (complete with a Window Manager, IDE, Web Browser, and  
even some games) written entirely in assembly: http://www.menuetos.net/


Everyone has 24 hours in a day, but some use it more than others ;)

--
Anant


Re: [9fans] Hello Assembly

2008-02-10 Thread Pietro Gagliardi

On Feb 10, 2008, at 3:56 AM, Martin Neubauer wrote:


(Research) Unix was influential in that
regard and showed that those parts are really small (and should be).

Martin


I am working on rewriting an operating system that avoids this  
philosophy for the purpose of teaching assembly language. So far, I  
have 2% of the code (I started a rewrite), and I don't know if my  
code is 100% right.




Re: [9fans] Hello Assembly

2008-02-10 Thread Martin Neubauer
* Eris Discordia ([EMAIL PROTECTED]) wrote:
> That is probably because assembly was never intended for moving from one  
> platform to another all the time, but for squeezing the most out of a  
> given platform whose nooks and crannies you ken well.

Nah, that's only what the intel assembler is for. Originally, assembly
language was devised for not having to type in machine opcodes directly.
With the advent of high level programming laguages its main merit became the
ability to write those bits of operating system code that just cannot be
written in a high level language. (Research) Unix was influential in that
regard and showed that those parts are really small (and should be).

Martin



Re: [9fans] Hello Assembly

2008-02-10 Thread Anant Narayanan

DATAstring<>+0(SB)/8, $"Hello\n\z\z"


Why are there two \zs? Shouldn't one be enough?


One should be enough, but 8c -S does two \z's (probably to pad it out  
to exactly 8 bytes). It works either way, since the length we pass as  
an argument to pwrite is still $7.


Regards,
Anant


Re: [9fans] Hello Assembly

2008-02-10 Thread Eris Discordia
On Sat, 09 Feb 2008 17:32:26 -, Charles Forsyth  
<[EMAIL PROTECTED]> wrote:


the assembler is really just a front-end to the loader, and nothing to  
do with `at&t syntax'.


For the first ten minutes after reading that, I was wondering what the  
comment meant. Then I remembered in Plan 9 speak the loader means the  
linker. So, I gather from what you have pointed out that 8a assembly is  
actually some sort of intermediate language like MSIL (or GNU's version of  
AT&T assembly for the GCC backend).


and the <>) but generally i agree with brantley.  some weeks i'm working  
with several processors,
even several a day, and the `native' (in what sense? does the processor  
implement them?)
assemblers typically differ in operand order, basic mnemonics (l/st vs  
mov), and other conventions,
whereas the ?a family is uniformly data flow, and tends to use similar  
instructions for
similar things.  i find it much easier moving from platform to platform  
with it.


That is probably because assembly was never intended for moving from one  
platform to another all the time, but for squeezing the most out of a  
given platform whose nooks and crannies you ken well.


The notion of a "native" assembler sounds strange to me. Netwide (nasm) is  
known for being available on many software/hardware platforms with similar  
syntax (the Intel syntax) all over. Of course, the instruction sets are  
far from identical but the syntax is still (almost) the same. Register  
access, for instance, is done by simply naming the register in an  
instruction:


mov eax, 00h

Compared to the AT&T syntax (for GNU assembler):

movl$0x0, %eax

(three extra keystrokes to get the same op-code)

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


Re: [9fans] Hello Assembly

2008-02-10 Thread maht

If you love assembly code, you are in need of a CAT scan in my view.


chances are the CAT scanner was programmed in assembler !