I agree, for example you may not have the right Ethernet card and need to buy one etc.Combuster wrote:It's a donation, not a hired job. At least he's trying to give him his pennies worth, and if I wasn't epicly busy I would've done that it for that price (after all, someone else would need a stack too in due time).
Bounty: TCP/IP stack for BareMetal OS
Re: Bounty: TCP/IP stack for BareMetal OS
Re: Bounty: TCP/IP stack for BareMetal OS
No, not only for completeness. As I wrote: "The point is, you'll need to implement datagram service anyway, even if you don't want UDP. That's all I say."Brynet-Inc wrote:No.turdus wrote:But TCP is, and TCP is build on top of UDP, ICMP and ARP.
TCP and UDP are independent protocols, you do not need to implement both, but you should for sake of completness.
Agreed.Brynet-Inc wrote:I still say this bounty is rather absurd and poorly thought out, this supposed payout of $500 is hardly worth the effort of writing an entirely TCP/IP stack in assembly.. especially in the time allotted.
For the OP:
From another thread, there was a link to a promo video of generating primes (ca. 10000 primes in 10 secs on a 1.5GHz). You are doing it wrong.
Seriously ReturnInfinity, what kind of crappy prime generating algorithm did you use? I wrote a small unoptimized C code to generate primes, and tested on a 1733Mhz machine (that was the closest to your's I could get) in a multitask environment (linux). It took less than a sec to generate 10 000 primes. Within 16 secs I could generate 100 000. And it can be even faster if rewritten and optimized in assembly and run alone on a bare metal node. Do you need the algorithm? It would look better on promo video, don't you think?
I won't write TCP/IP stack for your OS, but I can give you the C code (no more than 40 lines) or rewrite it in x86_64 asm if you like.
Re: Bounty: TCP/IP stack for BareMetal OS
From my understanding, it's written in Cturdus wrote: For the OP:
From another thread, there was a link to a promo video of generating primes (ca. 10000 primes in 10 secs on a 1.5GHz). You are doing it wrong.
Seriously ReturnInfinity, what kind of crappy prime generating algorithm did you use? I wrote a small unoptimized C code to generate primes, and tested on a 1733Mhz machine (that was the closest to your's I could get) in a multitask environment (linux). It took less than a sec to generate 10 000 primes. Within 16 secs I could generate 100 000. And it can be even faster if rewritten and optimized in assembly and run alone on a bare metal node. Do you need the algorithm? It would look better on promo video, don't you think?
I won't write TCP/IP stack for your OS, but I can give you the C code (no more than 40 lines) or rewrite it in x86_64 asm if you like.
See here:
http://www.returninfinity.com/docs/Bare ... mples.html
Re: Bounty: TCP/IP stack for BareMetal OS
Probably not a huge problem in this case. You need just any NIC that the OS has a driver for. That's about 2.69 EUR for a rtl8139.guyfawkes wrote:I agree, for example you may not have the right Ethernet card and need to buy one etc.
Yeah, if what you're trying to say is that UDP doesn't add much to IP, so you could just as well implement it when you do IP, I can see your point. It still must be wired up so that applications can use it, and depending on whether you can reuse your TCP interfaces that may actually take more effort than the actual UDP implementation itself.turdus wrote:No, not only for completeness. As I wrote: "The point is, you'll need to implement datagram service anyway, even if you don't want UDP. That's all I say."
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Bounty: TCP/IP stack for BareMetal OS
More important than being technically correct though, you need UDP to support DNS. You want DNS. Really.
Re: Bounty: TCP/IP stack for BareMetal OS
You don't strictly need UDP for it. It's also defined for TCP, even though it's rather uncommon to use that.
Re: Bounty: TCP/IP stack for BareMetal OS
A mathematical algorithm is an algorithm regardless of what language it's implemented in. I offer the C code as a template for assembly, and I also offer to rewrite it in asm if ReturnInfinity prefers. Please don't start the language war here.guyfawkes wrote:From my understanding, it's written in C
Last edited by turdus on Thu Dec 08, 2011 4:43 pm, edited 1 time in total.
Re: Bounty: TCP/IP stack for BareMetal OS
Exactly. By the way Combuster's DNS is another really good point.Kevin wrote:...that may actually take more effort than the actual UDP implementation itself.
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
Re: Bounty: TCP/IP stack for BareMetal OS
The RFC specifies that clients should attempt TCP if the request is too large or the server returns the TC (..truncate) flag.Kevin wrote:You don't strictly need UDP for it. It's also defined for TCP, even though it's rather uncommon to use that.
On OpenBSD, you can force TCP in resolv.conf, which makes it handy for tunnelling DNS over proxies.
Re: Bounty: TCP/IP stack for BareMetal OS
The code for what was shown in the video is here: http://cl.ly/CSCEturdus wrote:For the OP:
From another thread, there was a link to a promo video of generating primes (ca. 10000 primes in 10 secs on a 1.5GHz). You are doing it wrong.
Seriously ReturnInfinity, what kind of crappy prime generating algorithm did you use? I wrote a small unoptimized C code to generate primes, and tested on a 1733Mhz machine (that was the closest to your's I could get) in a multitask environment (linux). It took less than a sec to generate 10 000 primes. Within 16 secs I could generate 100 000. And it can be even faster if rewritten and optimized in assembly and run alone on a bare metal node. Do you need the algorithm? It would look better on promo video, don't you think?
I won't write TCP/IP stack for your OS, but I can give you the C code (no more than 40 lines) or rewrite it in x86_64 asm if you like.
If you have something better then I would gladly use it. The code above was from before I implemented newlib to get the standard ANSI C calls.
As for hardware none should be required. BareMetal OS has drivers for the Intel 8254x (E1000) so the entire dev setup can be virtual. Personally I use VirtualBox.
There is no set date to have this completed by and any help would be appreciated. I'm going to start looking into it myself as well.
-Ian
BareMetal OS - http://www.returninfinity.com/
Mono-tasking 64-bit OS for x86-64 based computers, written entirely in Assembly
Mono-tasking 64-bit OS for x86-64 based computers, written entirely in Assembly
Re: Bounty: TCP/IP stack for BareMetal OS
You use the brute force methodReturnInfinity wrote: The code for what was shown in the video is here: http://cl.ly/CSCE
If you have something better then I would gladly use it. The code above was from before I implemented newlib to get the standard ANSI C calls.
As for hardware none should be required. BareMetal OS has drivers for the Intel 8254x (E1000) so the entire dev setup can be virtual. Personally I use VirtualBox.
There is no set date to have this completed by and any help would be appreciated. I'm going to start looking into it myself as well.
-Ian
I suggest to use Sieve of Erathosthenes, much much faster: http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
The basic algorithm is the same as yours, but
a) no need to check for even numbers (j+=2 instead of j++)
b) no need to check division by any other number than previously found primes
c) because 3 is the smallest odd prime, it's enough to check number till i/3 instead of i-1
Here's my (really unoptimized) code (compile with gcc primes.c -o primes):
Code: Select all
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
//global variables
long *primes=NULL; //array to hold the primes
long num_primes=0; //number of elements in primes array
void is_prime(long n)
{
long prime=0,i,third;
//sort out even numbers (sanity check)
if(n%2==0) return;
//shortcut for the first 4 primes
if(n==1 || n==3 || n==5 || n==7) prime=n;
else {
prime=n; third=n/3;
for(i=1;i<num_primes && primes[i]<=third;i++) if(n%(primes[i])==0) { prime=0; break; }
}
//if it's a prime, append it to our list
if(prime){
primes=realloc(primes,(num_primes+1)*sizeof(long));
primes[num_primes]=prime;
num_primes++;
}
}
//the main function
int main(int argc,char **argv)
{
long argument,i;
time_t s=0,e=0;
FILE *f;
//if we have an argument then use it, if not, ask for it
if(argv[1]!=NULL) argument=strtol(argv[1],NULL,10);
else {
printf("Number of primes to generate? ");
scanf("%ld",&argument);
}
printf("Generating primes... "); fflush(stdout);
time(&s);
//check every odd number
for(i=1;num_primes<argument;i+=2) is_prime(i);
time(&e);
printf("OK (%d secs)\n",(int)(e-s));
//save primes for later
f=fopen("primes.txt","w+");
for(i=0;i<num_primes;i++) fprintf(f,"%ld\n",primes[i]);
fclose(f);
}
Re: Bounty: TCP/IP stack for BareMetal OS
@Combuster: Free up your schedule then
Still looking for someone interested in helping with this.
-Ian
Still looking for someone interested in helping with this.
-Ian
BareMetal OS - http://www.returninfinity.com/
Mono-tasking 64-bit OS for x86-64 based computers, written entirely in Assembly
Mono-tasking 64-bit OS for x86-64 based computers, written entirely in Assembly
Re: Bounty: TCP/IP stack for BareMetal OS
Hi ReturnInfinity ,
Combuster +1
500$ is a lot of money for someone in India . That amount is more than a months salary of many people. I will forward this link to some of my juniors in my college and let them get back to you . Even I could have helped , but it is not ethical for me to do so without permission and getting permission may not be very smooth
--Thomas
Combuster +1
500$ is a lot of money for someone in India . That amount is more than a months salary of many people. I will forward this link to some of my juniors in my college and let them get back to you . Even I could have helped , but it is not ethical for me to do so without permission and getting permission may not be very smooth
--Thomas
Re: Bounty: TCP/IP stack for BareMetal OS
Hi,
The point is that I am not THAT familiar with how to implement a TCP/IP stack myself. But, I do have the time to study on the topic, and I assure that I will give results. But I'm not sure if ReturnInfinity wants someone to give results NOW, or he can wait..
Regards,
Shikhin
Like me.Thomas wrote:500$ is a lot of money for someone in India.
The point is that I am not THAT familiar with how to implement a TCP/IP stack myself. But, I do have the time to study on the topic, and I assure that I will give results. But I'm not sure if ReturnInfinity wants someone to give results NOW, or he can wait..
Regards,
Shikhin
Re: Bounty: TCP/IP stack for BareMetal OS
Hmm. I never thought of that. The trouble would be finding someone who knows TCP/IP as well as x86-64 assembly. As soon as possible would be ideal but waiting is fine.
-Ian
-Ian
BareMetal OS - http://www.returninfinity.com/
Mono-tasking 64-bit OS for x86-64 based computers, written entirely in Assembly
Mono-tasking 64-bit OS for x86-64 based computers, written entirely in Assembly