--- Quote Start ---
originally posted by smcnutt@Oct 28 2005, 04:31 PM
if you want to get fancy, i like mike's web interface idea --- Quote End ---
Thing is, it's not even that fancy. In your eCos configuration, go to the "Basic Networking Framework" section, "HTTP Daemon" subsection, and check "Autostart HTTPD" and "Simple Web System Monitor". With that, and assuming you rebuild and program your board, you should be able to type in "
http://boardname/monitor" to your web browser and get a web page out of it. It's a pretty thorough "does the net work" test, for free.
Then to add your own, you just need to write some code like:
#include <cyg/httpd/httpd.h>
cyg_bool WWWHome(FILE* client, char* path, char* formdata, void*)
{
html_begin(client);
// print web page to client with lines like: fprintf(client, "<foo>%s</foo>\n", fooStr);
html_end(client);
return true;
}
CYG_HTTPD_TABLE_ENTRY(wwwHome, "/", WWWHome, 0);
And bam, your board has a home page. This makes debugging easier because you can just dump things to a web page and see how your system is doing at run time.
Once you build your ecos library, in your library's install directory (NOT the altera/kits/nios2/components/ecos/... directory), look in include/cyg/httpd/httpd.h. There's a lot of macros and stuff in there to help you make the page.
"Get" mode forms are also supported, so you can use this interface to change things, too. Be advised that these forms let you have a few small parameters, since it puts the form values into the URL, so it won't let you upload files.
--- Quote Start ---
originally posted by vava@Oct 28 2005, 04:41 PM
(1) where can i obtain the ppp library for ecos, i didn’t find it when i installed the os bundle on my winxp machine? how can it be built into my ecos library (using nios2configtool)? --- Quote End ---
I'll assume you've worked through the tutorial, at least up to where you get the simple web server/network support project built. If not, work through that, then the following will make more sense.
When you run nios2configtool, you get your setup window. First, if you have a configuration file already, load it. If not, select the "net" template (refer to the tutorial if you forgot what this means). Once this is done, you go to the "Build" menu and select "Packages". Somewhere in the left list is "PPP Support" or somesuch; select it and move it into your project. Click OK and you should see the PPP settings in your project window. Configure, save, clean, and build library as normal.
--- Quote Start ---
originally posted by vava+oct 28 2005, 04:41 pm--><div class='quotetop'>quote (vava @ oct 28 2005, 04:41 pm)</div>
--- quote start ---
(2) i was thinking that i would use separate threads for each of the tasks[/b]
--- quote end ---
that's pretty standard; it should work.
--- quote start ---
originally posted by vava@oct 28 2005, 04:41 pm
is there any limitation on how many threads i can have?
--- quote end ---
memory, and scheduler resources. i think there's a setting in the ecos kernel section for it. do you need more than 30?
<!--quotebegin-vava@Oct 28 2005, 04:41 PM
(3) i also understand from the documentation that heap memory can not be allocated in ecos, and that all buffers must be statically allocated; is this true? --- Quote End ---
News to me. I've been using malloc()/free() in C and new/delete in C++ for a while now. The "net" template turns on heap support, IIRC.
--- Quote Start ---
originally posted by vava+oct 28 2005, 04:41 pm--><div class='quotetop'>quote (vava @ oct 28 2005, 04:41 pm)</div>
--- quote start ---
(1) given the extremely short amount of time to complete this project (~ 4 weeks from today), would it be better to use ecos or uclinux?[/b]
--- quote end ---
honestly, given that schedule, whichever you choose, the other one is going to look like the better choice three weeks from now. with ecos, there's more work getting your makke file set up. with uclinux, you have to create a kernel, root filesystem, and application, fit all that in the flash somehow, and get it to boot right. either way, you're in for a good deal of work.
--- quote start ---
originally posted by vava@oct 28 2005, 04:41 pm
(2) from what i’ve gleaned from the uclinux forum, it looks as though this os is more full-featured, with the ability to develop standalone applications, which run from within a linux command shell. is this a fair assessment?
--- quote end ---
yes. don't forget the several-seconds startup time for linux. this is far more relevant to embedded systems than your average computer.
--- quote start ---
originally posted by vava@oct 28 2005, 04:41 pm
how does ecos differ from uclinux?
--- quote end ---
no easy answer. linux is a timesharing operating system patterned after unix. ecos is a real-time operating system. both are posix compliant, and both are free software.
<!--quotebegin-vava@Oct 28 2005, 04:41 PM
(3) is there a port uclinux for the nios ii cyclone i/ii fpga’s? --- Quote End ---
Check the uCLinux section on this board and download it from there.