RetroBSD

2.11BSD operating system for microcontrollers
It is currently Sat Jul 20, 2019 7:13 am

All times are UTC




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: SQLite3
PostPosted: Sat Jan 16, 2016 4:42 am 
User avatar

Joined: Fri Mar 06, 2015 9:13 pm
Posts: 37
Location: Barcelona, SP
This is another amazing/interesting app

First tests running ;)

optmizing pre-processor flags to maximize performance, but at moment it works !!

Code:
mbp:src mferrera$ kermit -c
Connecting to /dev/tty.SLAB_USBtoUART, speed 115200
 Escape character: Ctrl-B (ASCII 2, STX): enabled
Type the escape character followed by C to get back,
or followed by ? to see other options.
----------------------------------------------------
Copyright (c) 1982, 1986, 1989, 1991, 1993
   The Regents of the University of California.  All rights reserved.

4.4BSD-Lite build 0 compiled 2016-01-12
    mferrera@mbp.local:src/sys/compile/WHITECATOSHW.pic32
cpu: PIC32MZ2048ECH064 rev A5, 200 MHz
oscillator: system PLL div 1:6 mult x50
cache: 16/4 kbytes
real mem = 512 kbytes
avail mem = 356 kbytes
using 16 buffers containing 65536 bytes of memory
spi2 at pins sdi=RG7/sdo=RG8/sck=RG6
en0 at interrupt 153, MAC address d8:80:39:1c:17:d9
en0: <SMSC LAN8720A> at address 1
uart1 at pins rx=RF4/tx=RF5, interrupts 112/113/114, console
sd0 at port spi2, pin cs=RG9
sd0: function groups 1/1/1/1/4001/1
sd0: type SDHC, size 7761920 kbytes, speed 25 Mbit/sec
sd0a: partition type b7, sector 2, size 131072 kbytes
sd0b: partition type b8, sector 262146, size 32768 kbytes
WARNING: preposterous clock chip time -- CHECK AND RESET THE DATE!

starting file system checks.
/dev/rsd0a: file system is clean; not checking
starting network
add net default: gateway 192.168.1.1
en0: link up, 100Mbps, full duplex
clearing /tmp
standard daemons: update inetd.
Tue Jan  5 00:58:53 PST 2016


4.4BSD-Lite (bsd.net) (console)

login: root
Password:
Last login: Tue Jan  5 00:18:55 on console
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
        The Regents of the University of California.   All rights reserved.

4.4BSD-Lite UNIX #1: Fri Apr 01 00:00:00 PDT 1994

Welcome to 4.4BSD-Lite!

erase ^H, kill ^U, intr ^C status ^T
Don't login as root, use the su command.
4.4BSD # ./sqlite3 ex1
SQLite version 3.10.1 2016-01-13 21:41:56
Enter ".help" for usage hints.
sqlite> .databases
seq  name             file                                                     
---  ---------------  ----------------------------------------------------------
0    main             /root/ex1                                                 
sqlite> .schema tbl1
CREATE TABLE tbl1(one varchar(10), two smallint);
sqlite> select * from tbl1;
hello!|10
goodbye|20
sqlite>


Usage;
https://www.sqlite.org/cli.html


Attachments:
sqlite3.zip [926.25 KiB]
Downloaded 310 times

_________________
Dennis MacAlistair Ritchie (Sep.09.1941 - Oct.12.2011)
Top
 Profile  
 
 Post subject: Re: SQLite3
PostPosted: Sat Jan 16, 2016 5:06 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Wow, it's 626kbytes of binary code, and the executable still fits into memory, thanks to paging.
Spectacular!


Top
 Profile  
 
 Post subject: Re: SQLite3
PostPosted: Sat Jan 16, 2016 5:15 am 
User avatar

Joined: Fri Mar 06, 2015 9:13 pm
Posts: 37
Location: Barcelona, SP
vak wrote:
Wow, it's 626kbytes of binary code, and the executable still fits into memory, thanks to paging.
Spectacular!


Yes, the "LittleBSD" :) manage it.... pretty nice !!

I'm working now to fill tables until see the limits.... but for IoT and logging things will be nice it....

_________________
Dennis MacAlistair Ritchie (Sep.09.1941 - Oct.12.2011)


Top
 Profile  
 
 Post subject: Re: SQLite3
PostPosted: Sat Jan 16, 2016 5:15 am 
Contributor
User avatar

Joined: Sun Oct 20, 2013 3:15 am
Posts: 322
Can we put that in base? It makes pkgsrc basically a done deal then once a stable toolchain exists :)
Also, do you have the source available (or at least the steps to reproduce what you did).

_________________
@__briancallahan on Twitter


Top
 Profile  
 
 Post subject: Re: SQLite3
PostPosted: Sat Jan 16, 2016 5:23 am 
User avatar

Joined: Fri Mar 06, 2015 9:13 pm
Posts: 37
Location: Barcelona, SP
ibara wrote:
Can we put that in base? It makes pkgsrc basically a done deal then once a stable toolchain exists :)
Also, do you have the source available (or at least the steps to reproduce what you did).


Sure ibara
https://github.com/whitecatboard/LiteBSD/tree/master/apps/sqlite3
https://github.com/whitecatboard/LiteBSD/blob/master/apps/sqlite3/nbproject/Makefile-Debug.mk

And source as comes from the sqlite page, from here.
https://www.sqlite.org/download.html

_________________
Dennis MacAlistair Ritchie (Sep.09.1941 - Oct.12.2011)


Top
 Profile  
 
 Post subject: Re: SQLite3
PostPosted: Sun Jan 17, 2016 12:35 am 
Contributor
User avatar

Joined: Sun Oct 20, 2013 3:15 am
Posts: 322
I pushed a new branch that adds sqlite3. It's separated out between libsqlite3.a (the library) and sqlite3 (the program, which lives in usr.bin) but done so in a way there there's no redundant compiling.
https://github.com/sergev/LiteBSD/commi ... 530b11ee7c

_________________
@__briancallahan on Twitter


Top
 Profile  
 
 Post subject: Re: SQLite3
PostPosted: Sun Jan 17, 2016 12:43 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1092
Hi Pito and Serge and all,

I think it would be fun to see how big a program we can now execute in LiteBSD.

How about a 1GB sized program!! Maybe with a HUGE data file.

Pretty neat....

Now we just gotta check that paging is working so a bunch of HUGE programs can execute at the 'same time'. Maybe they already can?

We really have a pretty cool system :).

I wonder how big 'static' kernel space is? Maybe loadable kernel drivers are next? Maybe they are already there?

Once loaded, drivers need to be able to be 'fixed' into kernel memory so interrupts will work usefully.

Lots of fun :).

Wiz


Top
 Profile  
 
 Post subject: Re: SQLite3
PostPosted: Fri Jan 22, 2016 1:58 am 
Contributor
User avatar

Joined: Sun Oct 20, 2013 3:15 am
Posts: 322
Soon to be available in base
https://github.com/sergev/LiteBSD/pull/39

_________________
@__briancallahan on Twitter


Top
 Profile  
 
 Post subject: Re: SQLite3
PostPosted: Fri Jan 22, 2016 7:53 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
What about the size of resulting sqlite3 binary?
Well, let me merge it first, and we'll see...


Top
 Profile  
 
 Post subject: Re: SQLite3
PostPosted: Fri Jan 22, 2016 7:59 am 
Contributor
User avatar

Joined: Sun Oct 20, 2013 3:15 am
Posts: 322
The binary shouldn't be any bigger.
Any differences in size would be me not using all of Mikeloto's compile flags.

_________________
@__briancallahan on Twitter


Top
 Profile  
 
 Post subject: Re: SQLite3
PostPosted: Fri Jan 22, 2016 8:26 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Code:
# size sqlite3               
    text    data    bss      dec       hex   filename
  749664   12048   8372   770084   0xbc024   sqlite3

It's 6x times bigger than the amount of physical memory available to user processes. Fortunately, it does not need all it's code at once, so the paging helps.


Top
 Profile  
 
 Post subject: Re: SQLite3
PostPosted: Fri Jan 22, 2016 4:37 pm 
Contributor
User avatar

Joined: Sun Oct 20, 2013 3:15 am
Posts: 322
Right; I guess what I'm asking is if that's any different than the binary Mikeloto originally posted.

_________________
@__briancallahan on Twitter


Top
 Profile  
 
 Post subject: Re: SQLite3
PostPosted: Fri Jan 22, 2016 5:07 pm 
User avatar

Joined: Fri Mar 06, 2015 9:13 pm
Posts: 37
Location: Barcelona, SP
ibara wrote:
Right; I guess what I'm asking is if that's any different than the binary Mikeloto originally posted.


It's the amalgamation version of sqlite3 maybe the normal project will be better because can choose sources to compile, etc....

Also ibara vak if have a little time can take a look at these editor http://www.jbox.dk/sanos/editor.htm with few modifications compiles but not runs on the LiteBSD box, it's strange because gives kernel paging error , etc..., they don't executes first line after main() :?:

I don't have a LiteBSD box now to try it but we have the editor running on the LuaOS development and like the simple and minimalistic http server developed by this guy, this editor is also amazing and simple, maybe will be interesting to find the issue on the binary.

_________________
Dennis MacAlistair Ritchie (Sep.09.1941 - Oct.12.2011)


Top
 Profile  
 
 Post subject: Re: SQLite3
PostPosted: Sat Jan 23, 2016 6:54 am 
Contributor
User avatar

Joined: Sun Oct 20, 2013 3:15 am
Posts: 322
If you're looking for a simple text editor, my LiteBSD-Ports repo has editors/ee. ee is the Easy Editor included in FreeBSD and DragonFly BSD.

No package, you'll have to build it yourself but that's easy:
1. cd to your LiteBSD src directory
2. $ git clone https://github.com/ibara/LiteBSD-Ports.git
3. cd LiteBSD-Ports/editors/ee
4. bmake install

_________________
@__briancallahan on Twitter


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron




Powered by phpBB® Forum Software © phpBB Group

BSD Daemon used with permission