the source code is from stlport-4.6.2, and take reference 'mona' os,
and it's run well in my c++ kernel.
usage:
download and tar 2 you kernel dir:
http://blogimg.chinaunix.net/blog/upfil ... 092828.bz2
need for stlport: include/_stlport.h
function in the file need implement, such as 'strcpy, memcpy, malloc, free',
and you *MUST* use stlport after memory managerment init.
test code in kernel:
Code: Select all
#include <include/common.h>
#include <drivers/char/vga.h>
#include <vector>
using namespace std;
void do_test()
{
typedef vector<int> DataList;
DataList list;
list.push_back(8);
list.push_back(6);
list.push_back(4);
list.push_back(12);
list.push_back(14);
list.push_back(16);
list.push_back(18);
printk_color(TEXT_COLOR_LIGHTBLUE, "stlport test: list size is %d, data is ", list.size());
for (DataList::iterator it = list.begin(); it != list.end(); it++) {
printk_color(TEXT_COLOR_LIGHTBLUE, "%d, ", *it);
}
printk_color(TEXT_COLOR_LIGHTBLUE, "\n");
}