Creando un bootloader en lima

Lim22 (lima interpreter + makelima program pack)
type mkl for swich to makelima
type lima for swich to lima
*lima@Lim22 interpreter
> mkl
*makelima@Lim22 compiler
> C:\Users\erick\OneDrive\ErickCraftStudiosMgrChannel\Saved Proyects\LimonadeOS\makelima.mkl
*makelima@Lim22 compiler
>
*makelima@Lim22 compiler
> lima
*lima@Lim22 interpreter
> C:\Users\erick\OneDrive\ErickCraftStudiosMgrChannel\Saved Proyects\LimonadeOS\image\bootx64.lima
file "bootx64.lima" has been loaded.
file "fs.lima" has been loaded.
file "hello.bin" has been loaded.
file "readme.bin" has been loaded.
root@localhost: ~#
root@localhost: ~# shutdown NOW
root@localhost: ~# shutdown NOW
root@localhost: ~# shutdown NOW
root@localhost: ~# shutdown NOW
root@localhost: ~# shutdown NOW
root@localhost: ~# shutdown NOW
root@localhost: ~# shutdown NOW
root@localhost: ~#
root@localhost: ~#
root@localhost: ~#
root@localhost: ~#
root@localhost: ~#
root@localhost: ~#
root@localhost: ~#
root@localhost: ~#
root@localhost: ~#
root@localhost: ~#
root@localhost: ~#
root@localhost: ~#
root@localhost: ~#
root@localhost: ~# shutdown NOW
root@localhost: ~# shutdown NOW
root@localhost: ~# shutdown NOW
root@localhost: ~# shutdown NOW
root@localhost: ~# shutdown NOW
root@localhost: ~# HELL
root@localhost: ~# hello
hello world
file "bootx64.lima" has been loaded.
file "fs.lima" has been loaded.
file "hello.bin" has been loaded.
file "readme.bin" has been loaded.
root@localhost: ~# hello
hello world
file "bootx64.lima" has been loaded.
file "fs.lima" has been loaded.
file "hello.bin" has been loaded.
file "readme.bin" has been loaded.
root@localhost: ~# hello
hello world
file "bootx64.lima" has been loaded.
file "fs.lima" has been loaded.
file "hello.bin" has been loaded.
file "readme.bin" has been loaded.
root@localhost: ~# hello
hello world
file "bootx64.lima" has been loaded.
file "fs.lima" has been loaded.
file "hello.bin" has been loaded.
file "readme.bin" has been loaded.
root@localhost: ~# hello
hello world
file "bootx64.lima" has been loaded.
file "fs.lima" has been loaded.
file "hello.bin" has been loaded.
file "readme.bin" has been loaded.
root@localhost: ~# hello
hello world
file "bootx64.lima" has been loaded.
file "fs.lima" has been loaded.
file "hello.bin" has been loaded.
file "readme.bin" has been loaded.
root@localhost: ~# hello
hello world
file "bootx64.lima" has been loaded.
file "fs.lima" has been loaded.
file "hello.bin" has been loaded.
file "readme.bin" has been loaded.
root@localhost: ~# hello
hello world
file "bootx64.lima" has been loaded.
file "fs.lima" has been loaded.
file "hello.bin" has been loaded.
file "readme.bin" has been loaded.
root@localhost: ~# hello
hello world
file "bootx64.lima" has been loaded.
file "fs.lima" has been loaded.
file "hello.bin" has been loaded.
file "readme.bin" has been loaded.
root@localhost: ~# hello
hello world
file "bootx64.lima" has been loaded.
file "fs.lima" has been loaded.
file "hello.bin" has been loaded.
file "readme.bin" has been loaded.
root@localhost: ~# hello
hello world
file "bootx64.lima" has been loaded.
file "fs.lima" has been loaded.
file "hello.bin" has been loaded.
file "readme.bin" has been loaded.
root@localhost: ~# hello
hello world
file "bootx64.lima" has been loaded.
file "fs.lima" has been loaded.
file "hello.bin" has been loaded.
file "readme.bin" has been loaded.
root@localhost: ~# hello
hello world
file "bootx64.lima" has been loaded.
file "fs.lima" has been loaded.
file "hello.bin" has been loaded.
file "readme.bin" has been loaded.
root@localhost: ~# hello
hello world
file "bootx64.lima" has been loaded.
file "fs.lima" has been loaded.
file "hello.bin" has been loaded.
file "readme.bin" has been loaded.
root@localhost: ~# hello
hello world
file "bootx64.lima" has been loaded.
file "fs.lima" has been loaded.
file "hello.bin" has been loaded.
file "readme.bin" has been loaded.
root@localhost: ~# hello
hello world
file "bootx64.lima" has been loaded.
file "fs.lima" has been loaded.
file "hello.bin" has been loaded.
file "readme.bin" has been loaded.
root@localhost: ~# hello
hello world
file "bootx64.lima" has been loaded.
file "fs.lima" has been loaded.
file "hello.bin" has been loaded.
file "readme.bin" has been loaded.
root@localhost: ~# hello
hello world
file "bootx64.lima" has been loaded.
file "fs.lima" has been loaded.
file "hello.bin" has been loaded.
file "readme.bin" has been loaded.
root@localhost: ~# hello
hello world
file "bootx64.lima" has been loaded.
file "fs.lima" has been loaded.
file "hello.bin" has been loaded.
file "readme.bin" has been loaded.
root@localhost: ~# hello
hello world
file "bootx64.lima" has been loaded.
file "fs.lima" has been loaded.
file "hello.bin" has been loaded.
file "readme.bin" has been loaded.
root@localhost: ~# hello
hello world
file "bootx64.lima" has been loaded.
file "fs.lima" has been loaded.
file "hello.bin" has been loaded.
file "readme.bin" has been loaded.
root@localhost: ~# hello
hello world
file "bootx64.lima" has been loaded.
file "fs.lima" has been loaded.
file "hello.bin" has been loaded.
file "readme.bin" has been loaded.
root@localhost: ~# hello
hello world
file "bootx64.lima" has been loaded.
file "fs.lima" has been loaded.
file "hello.bin" has been loaded.
file "readme.bin" has been loaded.
root@localhost: ~#
root@localhost: ~#
root@localhost: ~#
root@localhost: ~#
root@localhost: ~#
root@localhost: ~#
root@localhost: ~#
root@localhost: ~# hello
hello world
file "bootx64.lima" has been loaded.
file "fs.lima" has been loaded.
file "hello.bin" has been loaded.
file "readme.bin" has been loaded.
root@localhost: ~# HELL
root@localhost: ~#
root@localhost: ~# HELL
root@localhost: ~# shutdown NOW
root@localhost: ~# shutdown NOW
root@localhost: ~# shutdown NOW
root@localhost: ~# shutdown NOW
root@localhost: ~# shutdown NOW
root@localhost: ~# C:\Users\erick\OneDrive\ErickCraftStudiosMgrChannel\Saved Proyects\LimonadeOS\image\bootx64.lima
root@localhost: ~# shutdown NOW
root@localhost: ~# shutdown NOW
root@localhost: ~# join NOW
root@localhost: ~# join NOW
root@localhost: ~#
root@localhost: ~# join NOW
root@localhost: ~# join NOW
root@localhost: ~#







xd?

para que el sudo shutdown NOW?

por esto

# la rutina del la terminal
# @_action: the command to send
[intersegmental]
message shell()

var
    .cnd
    =
    (_action=="")

jt
    .loop

jump
    .command

# el bucle

section
.loop

#color fg bg

color 10 0
writel "root@localhost"

color 7 0

writel ": "

color 9 0
writel "~"

color 7 0
writel "# "

var
    Prompt
    =
    ReadLine

var
    _action
    =
    Prompt

jump
.command

# aqui agrega el sistema de comandos

jump
.loop

section
.command

var
    .cnd
    =
    (_action=="shutdown NOW")

jt
    .shudown

if
        (
            _action
            ==
            "hello"
            )
        {
            echo "hello world"
        }


popback

section
.shutdown
    color 9 0
    echo "shutdowning the system..."
__endprog__

[endmsg]

ah weno, ya entendi.

es que agregue el comando shutdown NOW que lo que hace es que si se puso ese comando se detenga la shell, como despues de la shell no hay nada mas pues , ahi termina el sistema

1 me gusta

ehy me ayudas ahacer el port de lima a js o a ts , es que a mi me da flojera , luego ahi te invito al repositorio para que workflees con tu vscode (si tienes) y podamis trabajar juntos en paralelo , o sino mejor en el server

1 me gusta

No se JS ni TS, te podría ayudar si es en Go

pero GO es porteable o mejor en el cplusplus,
y si te unes al ErickCraftStudios, y tambien invitas al alquimista (si el quiere y esta aqui con nosotros)

Ta bien, C++ también lo se, bueno, adiós, me tengo que ir

ya lo cancele por que era muy dificil portearlo a C++

Bueno, a mi si me interesa, me dejas portarlo a go?

Si pero. No será nada fácil :sweat_smile:, te deseo suerte por que ya lo intente pero es muy compldjo
Te recomiendo guiarte del código que esta en github para que sepas como funciona
Voy a comentar todo el codigo, te recomiendo que sepas inglés para entender los comentarios, si no los voy atener que pone en español pero ya lo voy a hacer, te recomiendo unas cosas, si te estas estrezando con alguna instrucción del lenguaje al portearlo dime cual y te dire como funciona, si vas a hacer el port intenta darme créditos por que si me costó hacer el lenguaje de programacion, y tambein si lo quieres subir a un repositorio subelo, no tengo ningún problema en que lo hagas, si quieres subelo

1 me gusta

Como Vaz con el intérprete portado?, hay algún avanze

Nope, no estaba en mi casa, acabo de llegar, ahorita me pondre a iniciarlo

con el tutorial de los programas hice este codigo para ejecutarlos

# la rutina del la terminal
# @_action: the command to send
[intersegmental]
message shell()

var
    .cnd
    =
    (_action=="")

jt
    .loop

jump
    .command

# el bucle

section
.loop

#color fg bg

color 10 0
writel "root@localhost"

color 7 0

writel ": "

color 9 0
writel "~"

color 7 0
writel "# "

var
    Prompt
    =
    ReadLine

var
    _action
    =
    Prompt

jump
.command

# aqui agrega el sistema de comandos

jump
.loop

section
.command

var
    .cnd
    =
    (_action=="")

jt
    .loop

var
    .cnd
    =
    (_action=="shutdown NOW")

jt
    .shutdown

var
    .cnd
    =
    (_action=="cls")

jt
    .cls

var
    .cnd
    =
    _action(->)StartsWith "echo "

jt
    .echo

jf
    .execute_program

popback

section
.cls
cls
popback

# shutdown
# 
# Resumen:
# 	apagar el sistema
# 
section
.shutdown
    color 9 0
    echo "shutdowning the system..."
__endprog__

section
.echo
    var
        statment
        =
        _action

    var
        statment
        +=
        5

    echo statment

popback

# execute_program
# 
# Resumen:
# 	ejecutar un programa
# 
# Parametros:
#   @_action: el nombre y los parametros
section
.execute_program

    mov
        @eax
        "/string split"

    mov
        @bx
        " "

    mov
        @ax
        _action
        # se que ax es para el status de la operacion , pero lo necesitamos

    # mandar el comando
    %^"!p"

    var
        array
        =
        @ScratchVar(_returned)

    var
        program
        =
        array(->)[0]
        # obtener el item 0 (el nombre)

    var
        program
        StrCat=
        ".bin"

    var
        program
        =
        "fs0->"(..)program

    #
    # ajustar las variables del programa que usara para los parametros, ya los conozco desarrolladores
    #

    # literalmente asi se llaman las variablex xd

    var
        $1
        array(->)[1]

    var
        $2
        array(->)[2]

    var
        $3
        array(->)[3]

    var
        $4
        array(->)[4]

    var
        $5
        array(->)[5]

    var
        $6
        array(->)[6]

    var
        $7
        array(->)[7]

    var
        $8
        array(->)[8]

    var
        $9
        array(->)[9]

    var
        $10
        array(->)[10]

    # autoejecutar el codigo
    lex @ScratchVar(program)

popback

[endmsg]

ahorita subo el codigo del interprete ya comentado
ya lo subi , ahora podras entender que hace cada cosa, si ya descargaste Lima.cs descargalo de nuevo por que ya tiene los comentarios, Lim22/LimaInterpreter/Lima.cs at main · ErickStudios/Lim22

1 me gusta