Toro Kernel lazarus / 23-Operating Systems ---------------------------------------------------------------------- Blestan · 2017-01-21 20:17 Hi folks! i mentioned that in the past few months ne toro kernel is again in development. the creator of toro (Matias E. Vara)  is doing a great job to update the kernel !!! the tcp stack is updated and working ... i have the "briliant" idea to create a fpc cloud infrastruture for web apps based on toro/fpc. the main concepts are: 1/ monoblock app running in vm based on toro ( the base idea of toro) 2/ simple single user non concurent but async flie system ( todo - help needed on that) 3/ communication with intranet DB (mysql, postgres etc) and cache servers (redis, memcache  ...) .. native (no dll or .so ) clients implementations of the protocols is to be done - help needed... or maybe a thin tcp/http warpper based on json for communication with the servers? 4/ serving web requests on the extranet with a very fast (bare metal) http server 5/ running apps in vm deployed by platform like openskack 6/ no code injection possible due to the monoblock concept of toro - app is compiled and part of the kernel - one vm is runing a single kernel with the app embeded 7/ no interpreded languages - no risk 8/ minimal overhead no additional drivers except for ethernet and disk waiting for your comments and suggestions! ) ---------------------------------------------------------------------- z0rr0 · 2017-02-18 14:31 Hi everyone, I have just moved the toro repo to github: https://github.com/MatiasVara/torokernel. I am also trying to organize the TODO work by using project and issue sections. Fell free to go through! Regards, Matias. ---------------------------------------------------------------------- z0rr0 · 2017-06-17 15:13 Hi everyone, I would like to share my last work related with Toro. Toro is now able to run as KVM guest. This is still experimental but I think work is going well. To show this, I deployed ToroHello example in a VM which anyone can see by connecting a VNC client to 51.15.142.20:5900. This is still a very simple example however it shows how easily a freepascal application can be deployed in the cloud. This application is quite fast since there is no OS, only TORO.  Regards, Matias. ---------------------------------------------------------------------- Blestan · 2017-06-17 16:11 great new matias!!! on my side im advancing on the rest api backend ... soon we can test to compile the server under toro.. do you have an idea im is possible to deploy toro as a digital ocean droplet... cannot find any info about the vm they use... kvm docker or other... anyway toro is great ---------------------------------------------------------------------- SunyD · 2017-06-17 19:21 I would integrate PascalScript, then the user can create own applications. I am using pascalscript in my applications it is very usefull. You don't need LCL for PascalScript. I use it on Android too. ---------------------------------------------------------------------- Blestan · 2017-06-17 20:51 why to integrate. an interprerer when you can deploy native???? not only speeed degradation but also a security problem...you will have a nodejs server...why??? ---------------------------------------------------------------------- taazz · 2017-06-17 21:11 Quote from: Blestan on June 17, 2017, 10:51:45 pmwhy to integrate. an interprerer when you can deploy native???? not only speeed degradation but also a security problem...you will have a nodejs server...why??? as a programmable shell like bash but true programmable not a toy language. ---------------------------------------------------------------------- z0rr0 · 2017-06-18 11:07 Toro has very particular architecture in which certain applications are improved but other gets no too much benefices. Toro is good when an application can be split in pipelines. In that case, you can run every pipeline in a different core and then dedicate all the resources needed by core. This reduces a lot the overhead due to shared resources. In addition, switch context are very light. ---------------------------------------------------------------------- jc99 · 2017-06-18 14:17 Quote from: z0rr0 on June 17, 2017, 05:13:53 pmHi everyone, I would like to share my last work related with Toro. Toro is now able to run as KVM guest. This is still experimental but I think work is going well. To show this, I deployed ToroHello example in a VM which anyone can see by connecting a VNC client to 51.15.142.20:5900. This is still a very simple example however it shows how easily a freepascal application can be deployed in the cloud. This application is quite fast since there is no OS, only TORO.  Regards, Matias. If you like I Worked a little In ToroKernel I tried to put the KernelModuled in a Package, but I didn't without success (maybe you Could help) But I managed to get My Writepascal-demo running. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i // Toro Write Pascal Example.// Example using a minimal kernel to print "Pascal" in 3D // Changes : // 19/06/2017 First Version by Joe Care. // Copyright (c) 2017 Joe Care// All Rights Reserved        // This program is free software: you can redistribute it and/or modify// it under the terms of the GNU General Public License as published by// the Free Software Foundation, either version 3 of the License, or// (at your option) any later version. // This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the// GNU General Public License for more details. // You should have received a copy of the GNU General Public License// along with this program.  If not, see .  program WritePacal; {$IFDEF FPC} {$mode delphi}{$ENDIF} {$IMAGEBASE 4194304} // Configuring the RUN for Lazarus{$IFDEF WIN64}          {%RunCommand qemu- system-x86_64.exe -m 512 -smp 2 -drive format=raw,file=ToroHello.img}{$ELSE}{%RunCommand qemu-system-x86_64 -m 512 -smp 2 -drive format=raw,file=ToroHello.img}{$ENDIF}{%RunFlags BUILD-} // They are declared just the necessary units// The needed units depend on the hardware where you are running the applicationuses    Kernel in '..\rtl\Kernel.pas',    Process in '..\rtl\Process.pas',    Memory in '..\rtl\Memory.pas',    Debug in '..\rtl\Debug.pas',    Arch in '..\rtl\Arch.pas',    Filesystem in '..\rtl\Filesystem.pas',    Pci in '..\rtl\Drivers\Pci.pas',    Console in '..\rtl\Drivers\Console.pas'; const    i64: int64 = 1055120232691680095; (* This defines "Pascal" *)    cc: array[-3..3] of ShortString = (* Here are all string-constants *)        ('\ '#8' \  ',        #8'__    ',        #8'__/\  ',        '  '#8'    ',        #8'__/\  ',        '  '#8'    ',        #8'__/\  '); var    x, y, c: integer; begin    PrintStringLn(StringOfChar(cc[1][1], 78));    for y := 0 to 11 do      begin        PrintString(StringOfChar(cc[0][1], 13 - y));        for x := 0 to 16 do            for c := 1 to 5 + (x mod 3) and 2 do                if c <= length(cc[(x - 5) mod 4]) then                  PutC(cc[(((i64 shr ((x and 15) * 4 + y div 3)) and (3 -                        (y div 9) shl 1)) - 4 + (2 - y mod 3) shl 2) mod 4][c]);        PrintStringln();      end;    while True do        SysThreadSwitch;end. Put all together in the patch, even a defaultToro.xml (default-Project settings) Patch attached . ---------------------------------------------------------------------- z0rr0 · 2017-06-18 14:56 Thanks jc99! I have to replace the methods used to access the console. In Toro the console is written by using WriteConsole() method. I will do it and deploy it soon. ---------------------------------------------------------------------- jc99 · 2017-06-18 15:40 There is a problem with WriteConsole. My original code was: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i WriteConsole(Copy(CC[],1,5+2),[0]); that crashed of cause with the formating option Then i Tried: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i WriteConsole('%s',[Copy(CC[],1,5+2)]); that crashed because Copy() is no PtrUint So i exported the PrintString Procedure and enabled PutC to handle the backspace-Character First test looked promising, But then the next drawback: When you write something like 'abc'+s (:ansistring) you get an error (Wrong parameter in Concat) When you do copy(s {:ansistring = '123456'} ,1,7) The output went nuts (lot of stupid characters). When you do copy('123456' ,1,7) get an error (Wrong parameter ) Shortstring to ansistring . . That went on ... Before final version I tied Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i PrintString(CC[][c]); Error Char to ansistring wrong parameter. the final version With PutC exportet worked at last. Please rename the procedure (or overload it If you like) WriteConsole has no indication that it needs Format-Parameters a name like WriteConsoleFmt would indicate that, like the MessageFmt Function, Even in C printf means print formatted on the contrary to write that prints unformatted. ---------------------------------------------------------------------- jc99 · 2017-06-18 15:58 Quote from: z0rr0I have to replace the methods used to access the console. No, You don't. The trick to get the Write, Writeln, readln... working, is to handle/open the Input and Output- files. Demontration in the Wiki. BTW: attachts an image (preview) ---------------------------------------------------------------------- jc99 · 2017-06-18 16:15 A Mouse support/driver is missing, and i could contribute a graph unit that handles Vesa-Graphics (without the BGI-nonsens of cause) Mouse is needed/would be good when porting FV ---------------------------------------------------------------------- z0rr0 · 2017-06-18 17:18 Quote from: jc99 on June 18, 2017, 05:58:15 pmQuote from: z0rr0I have to replace the methods used to access the console. No, You don't. The trick to get the Write, Writeln, readln... working, is to handle/open the Input and Output- files. Demontration in the Wiki. BTW: attachts an image (preview) Sorry I misunderstood the previous messages. Thanks for the patch I will review it and implement it. ---------------------------------------------------------------------- jc99 · 2017-06-18 22:49 No problem, that happens Apart from those drawbacks I really like it, and very much appreciate your Work (Wow! WTG!) ---------------------------------------------------------------------- jc99 · 2017-06-19 11:20 Quote from: z0rr0 on June 18, 2017, 07:18:53 pmSorry I misunderstood the previous messages. Thanks for the patch I will review it and implement it. Try this one: It's the next version (reduced some possible incompatibilities longint(Pointer())-> PtrInt(Pointer()) ... In my opinion better File-structure (because binaries, project-files, source-code, rtl-Code are each in separate folders. and a Group-file + Project-Template-XML ---------------------------------------------------------------------- z0rr0 · 2017-06-19 14:39 HI, thanks for the patch I will review it later. I think for future contributions it could be better to fork toro kernel project from https://github.com/MatiasVara/torokernel and them submit a pull request. This allows to run several tests before the code is merged thus easing the integration with master. ---------------------------------------------------------------------- jma_sp · 2017-06-19 15:51 Hola Zorro, me alegra ver que después de tantos años sigues con el proyecto. De aquel tiempo en que ya permitía crear directorios....luego el Telnet....multiprocesador.....y ahora un nuevo paso.    Tenerlo funcionando bajo KVM es un paso importante puesto que cualquiera se lo puede instalar bajo un Linux en un pendrive.    Si le ponen un entorno gráfico simple puede ser interesante , siento no tener conocimientos más avanzados para ayudarte. 51.15.142.20:5900 ¿Con que software VNC se puede conectar? ¿alguna encryptación? Saludos. ---------------------------------------------------------------------- z0rr0 · 2017-06-19 17:31 Hi, thanks you can use any VNC viewer without encryption. ---------------------------------------------------------------------- jc99 · 2017-06-19 17:47 Quote from: z0rr0 on June 19, 2017, 04:39:24 pmHI, thanks for the patch I will review it later. I think for future contributions it could be better to fork toro kernel project from https://github.com/MatiasVara/torokernel and them submit a pull request. This allows to run several tests before the code is merged thus easing the integration with master. I just did ! ---------------------------------------------------------------------- z0rr0 · 2017-06-28 20:54 Hi everyone, I could make the networking works on KVM so I implemented a simple http server in Toro. You can connect it by opening http://212.47.247.255/ in the browser. If you want to see the console, the vnc is at port 5900. Networking is still very experimental!!! Cheers, Matias. ---------------------------------------------------------------------- avra · 2017-06-29 12:57 Quote from: z0rr0 on June 28, 2017, 10:54:10 pmI implemented a simple http server in Toro. You can connect it by opening http://212.47.247.255/ in the browser.Nope, not working. Even ping times out. ---------------------------------------------------------------------- z0rr0 · 2017-06-29 13:48 Hi, thanks for testing. It is working for me. Pings don't work. ---------------------------------------------------------------------- Thaddy · 2017-06-29 14:06 port 80 times out, but port 5900 responds.. (w/o vnc) Nice! ---------------------------------------------------------------------- jc99 · 2017-07-01 05:40 If we want to use the other components (and not having to rename everything) i'd vote for "toro" or "baremetal" as a TargetOS in the Compiler-Target options. So that there is no name-conflict when using the components.  BTW: int 10h is not working does anyone know how to circumvent this ? Or how to set the font8x8 mode ? ---------------------------------------------------------------------- z0rr0 · 2017-07-01 11:41 Hello, Quote from: jc99 on July 01, 2017, 07:40:43 amIf we want to use the other components (and not having to rename everything) i'd vote for "toro" or "baremetal" as a TargetOS in the Compiler-Target options. So that there is no name-conflict when using the components.  BTW: int 10h is not working does anyone know how to circumvent this ? Or how to set the font8x8 mode ? None of the ints that you use in DOS will work in Toro. Don't forget that the application is running in long mode. So if you want to access to graphical mode you should write a complete driver for that.  Regards, ---------------------------------------------------------------------- jc99 · 2017-07-01 12:54 All documentation i could find Say: set this set that and then int 10h ... Do you know a better solution ? Have you any documentation on VGA or video ? ---------------------------------------------------------------------- z0rr0 · 2017-07-15 20:08 Hi everyone, I just wrote down the procedure to get a Toro guest running on the Scaleway cloud (also applicable to a different cloud). Here you have the link http://torokerneleng.blogspot.co.uk/2017/07/deploy-toro-application- in-cloud-in-4.html to the blog. I also provide a Toro image that you can download and try so it is not needed to compile anything. If procedure goes well you will have a Toro guest running that you can connect by VNC to port 5901 of the host and also answers http connections to the port 80 of the host. Regards. ---------------------------------------------------------------------- z0rr0 · 2018-02-10 18:02 Hello everyone, I just created a docker image to ease the compilation of Toro kernel in Linux. I posted the procedure here http://torokerneleng.blogspot.com.es/2018/02/docker-image-to-compile- toro-on-linux.html if someone wants to try. Regards, Matias.