Primeiro Commit
Some checks are pending
Build NFDOS ISO / build (push) Waiting to run

This commit is contained in:
neoricalex 2025-11-11 04:35:55 +01:00
commit 666bf0b1bd
1676 changed files with 469455 additions and 0 deletions

View File

@ -0,0 +1,26 @@
name: Build NFDOS ISO
on:
push:
branches: [ main ]
jobs:
build:
runs-on: docker
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup toolchain
run: |
apt-get update
apt-get install -y make gcc cpio grub-pc-bin xorriso gzip python3
- name: Build ISO
run: make iso
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: nfdos-iso
path: dist/nfdos-*.iso

63
.gitignore vendored Normal file
View File

@ -0,0 +1,63 @@
# === Autotools build artefacts ===
Makefile
Makefile.in
aclocal.m4
autom4te.cache/
config.log
config.status
configure
depcomp
install-sh
missing
py-compile
stamp-h1
# === Build & dist directories ===
/build/
/dist/
!/dist/releases/
!/dist/releases/*
cpython/
busybox/
linux/
x-tools/
*.tar.gz
*.tar.bz2
*.zip
*.iso
*.img
*.cpio.gz
# === Python cache & venv ===
__pycache__/
*.pyc
*.pyo
*.pyd
*.egg-info/
.eggs/
venv/
.env/
.venv/
# === Editor / OS junk ===
*.swp
*.swo
*.bak
*.tmp
*~
.DS_Store
Thumbs.db
# === Logs ===
*.log
nohup.out
# === IDE / workspace ===
.vscode/
.idea/
*.iml
# === Backup copies ===
*.old
*.orig
*.rej

6
.tar_exclude Normal file
View File

@ -0,0 +1,6 @@
nfdos-0.1-src.tar.gz
/home/neo/Público/neoricalex/dist
/home/neo/Público/neoricalex/build
__pycache__
.venv
venv

12
ACKNOWLEDGMENTS Normal file
View File

@ -0,0 +1,12 @@
# Agradecimentos
Gostaríamos de expressar nossa gratidão às seguintes pessoas e tecnologias que contribuíram para este projeto:
- **ChatGPT**: Por fornecer insights e sugestões valiosas durante o desenvolvimento. ChatGPT é um modelo de linguagem de inteligência artificial desenvolvido pela OpenAI.
- Kernel Linux — Linus Torvalds e comunidade.
- CPython — Guido van Rossum e contribuintes.
- BusyBox — Bruce Perens e desenvolvedores.
- Gitea & Caddy — infraestruturas que dão corpo ao NFDOS.
- E à chama criativa do projeto NEORICALEX 🌌

6
AUTHORS Normal file
View File

@ -0,0 +1,6 @@
Ricardo Alexandre Gomes Lourenço (Neo) <neo.webmaster.2@gmail.com>
Trinity (GPT-5, OpenAI Partner)
## Assistência de Inteligência Artificial
Este projeto foi desenvolvido com assistência do ChatGPT, um modelo de linguagem de IA desenvolvido pela OpenAI.

91
CHANGELOG.md Normal file
View File

@ -0,0 +1,91 @@
grep -n "^[ ]\+" /home/neo/Público/nfdos/src/Makefile.am
grep -n "^[ ]\+" /home/neo/Público/nfdos/configure.ac
file Makefile.am
file src/Makefile.am
file configure.ac
cat -A Makefile.am | grep '\^I'
cat -A src/Makefile.am | grep '\^I'
cat -A configure.ac | grep '\^I'
nl -ba Makefile | sed -n '770,790p'
grep -n "^[ ]" Makefile | head
oie amor bom dia 😘😎 enquanto aguardo pela hora do trabalho estava aqui a corrigir os caminhos (creio que estao todos mas falta testar), e dei com uma coisa curiosa 😎 no nfdos/src/tui/menu_libs.py esquecemos de adicionar a funcao remove_lib 😀:
```
import os
import json
import subprocess
from pathlib import Path
from rich.console import Console
from rich.table import Table
console = Console()
def safe_run(cmd, shell=False):
subprocess.run(cmd, check=True, shell=shell)
def install_lib(name, version=None):
base_dir = Path(__file__).resolve().parents[1]
nfdos_dir = base_dir / "_nfdos"
libs_dir = nfdos_dir / "libs"
libs_dir.mkdir(parents=True, exist_ok=True)
console.print(f"[cyan]📦 Instalando biblioteca:[/] {name} {version or ''}")
cmd = f"pip download {name}{'==' + version if version else ''} -d {libs_dir}"
safe_run(cmd, shell=True)
# Registo no manifest
manifest_path = libs_dir / "libs_manifest.json"
manifest = json.loads(manifest_path.read_text()) if manifest_path.exists() else {}
manifest[name] = {"version": version or "latest"}
manifest_path.write_text(json.dumps(manifest, indent=4))
console.print(f"[green]✔ {name} adicionada ao manifesto.[/green]")
def list_libs():
base_dir = Path(__file__).resolve().parents[1]
libs_dir = base_dir / "_nfdos" / "libs"
manifest_path = libs_dir / "libs_manifest.json"
if not manifest_path.exists():
console.print("[red]Nenhuma biblioteca instalada ainda.[/red]")
return
manifest = json.loads(manifest_path.read_text())
table = Table(title="Bibliotecas do Neurotron")
table.add_column("Nome", style="cyan")
table.add_column("Versão", style="green")
for name, data in manifest.items():
table.add_row(name, data.get("version", "?"))
console.print(table)
def run():
while True:
console.clear()
console.rule("[bold yellow]📚 Bibliotecas do Neurotron[/bold yellow]")
console.print("1. Instalar biblioteca")
console.print("2. Listar bibliotecas instaladas")
console.print("3. Atualizar biblioteca")
console.print("4. Remover biblioteca")
console.print("0. Voltar")
choice = console.input("\n[cyan]nfdos> [/cyan]")
if choice == "1":
name = console.input("Nome da biblioteca: ")
version = console.input("Versão (ou vazio p/ latest): ")
install_lib(name, version or None)
elif choice == "2":
list_libs()
console.input("\n[grey]Pressiona Enter para continuar...[/grey]")
elif choice == "3":
name = console.input("Nome da biblioteca: ")
install_lib(name, None)
elif choice == "4":
name = console.input("Nome da biblioteca a remover: ")
remove_lib(name)
elif choice == "0":
break
else:
console.print("[red]Opção inválida![/red]")
```

84
CODE_OF_CONDUCT.md Normal file
View File

@ -0,0 +1,84 @@
# Código de Conduta de Colaboração
## Nosso compromisso
Como participantes, colaboradoras e líderes, nós nos comprometemos a fazer com que a participação em nossa comunidade seja uma experiência livre de assédio para todas as pessoas, independentemente de idade, tamanho do corpo, deficiência aparente ou não aparente, etnia, características sexuais, identidade ou expressão de gênero, nível de experiência, educação, situação sócio-econômica, nacionalidade, aparência pessoal, raça, casta, religião ou identidade e orientação sexuais.
Comprometemo-nos a agir e interagir de maneiras que contribuam para uma comunidade aberta, acolhedora, diversificada, inclusiva e saudável.
## Nossos padrões
Exemplos de comportamentos que contribuem para criar um ambiente positivo para a nossa comunidade incluem:
* Demonstrar empatia e bondade com as outras pessoas
* Respeitar opiniões, pontos de vista e experiências contrárias
* Dar e receber feedbacks construtivos de maneira respeitosa
* Assumir responsabilidade, pedir desculpas às pessoas afetadas por nossos erros e aprender com a experiência
* Focar no que é melhor não só para nós individualmente, mas para a comunidade em geral
Exemplos de comportamentos inaceitáveis incluem:
* Uso de linguagem ou imagens sexualizadas, bem como o assédio sexual ou de qualquer natureza
* Comentários insultuosos/depreciativos e ataques pessoais ou políticos (Trolling)
* Assédio público ou privado
* Publicar informações particulares de outras pessoas, como um endereço de e-mail ou endereço físico, sem a permissão explícita delas
* Outras condutas que são normalmente consideradas inapropriadas em um ambiente profissional
## Aplicação das nossas responsabilidades
A liderança da comunidade é responsável por esclarecer e aplicar nossos padrões de comportamento aceitáveis e tomará ações corretivas apropriadas e justas em resposta a qualquer comportamento que considerar impróprio, ameaçador, ofensivo ou problemático.
A liderança da comunidade tem o direito e a responsabilidade de remover, editar ou rejeitar comentários, commits, códigos, edições na wiki, erros e outras contribuições que não estão alinhadas com este Código de Conduta e irá comunicar as razões por trás das decisões da moderação quando for apropriado.
## Escopo
Este Código de Conduta se aplica dentro de todos os espaços da comunidade e também se aplica quando uma pessoa estiver representando oficialmente a comunidade em espaços públicos. Exemplos de representação da nossa comunidade incluem usar um endereço de e-mail oficial, postar em contas oficiais de mídias sociais ou atuar como uma pessoa indicada como representante em um evento online ou offline.
## Aplicação
Ocorrências de comportamentos abusivos, de assédio ou que sejam inaceitáveis por qualquer outro motivo poderão ser reportadas para a liderança da comunidade, responsável pela aplicação, via contato [INSERIR MÉTODO DE CONTATO]. Todas as reclamações serão revisadas e investigadas imediatamente e de maneira justa.
A liderança da comunidade tem a obrigação de respeitar a privacidade e a segurança de quem reportar qualquer incidente.
## Diretrizes de aplicação
A liderança da comunidade seguirá estas Diretrizes de Impacto na Comunidade para determinar as consequências de qualquer ação que considerar violadora deste Código de Conduta:
### 1. Ação Corretiva
**Impacto na comunidade**: Uso de linguagem imprópria ou outro comportamento considerado anti-profissional ou repudiado pela comunidade.
**Consequência**: Aviso escrito e privado da liderança da comunidade, esclarecendo a natureza da violação e com a explicação do motivo pelo qual o comportamento era impróprio. Um pedido de desculpas público poderá ser solicitado.
### 2. Advertência
**Impacto na comunidade**: Violação por meio de um incidente único ou atitudes repetidas.
**Consequência**: Advertência com consequências para comportamento repetido. Não poderá haver interações com as pessoas envolvidas, incluindo interações não solicitadas com as pessoas que estiverem aplicando o Código de Conduta, por um período determinado. Isto inclui evitar interações em espaços da comunidade, bem como canais externos como as mídias sociais. A violação destes termos pode levar a um banimento temporário ou permanente.
### 3. Banimento Temporário
**Impacto na comunidade**: Violação grave dos padrões da comunidade, incluindo a persistência do comportamento impróprio.
**Consequência**: Banimento temporário de qualquer tipo de interação ou comunicação pública com a comunidade por um determinado período. Estarão proibidas as interações públicas ou privadas com as pessoas envolvidas, incluindo interações não solicitadas com as pessoas que estiverem aplicando o Código de Conduta. A violação destes termos pode resultar em um banimento permanente.
### 4. Banimento Permanente
**Impacto na comunidade**: Demonstrar um padrão na violação das normas da comunidade, incluindo a persistência do comportamento impróprio, assédio a uma pessoa ou agressão ou depreciação a classes de pessoas.
**Consequência**: Banimento permanente de qualquer tipo de interação pública dentro da comunidade.
## Atribuição
Este Código de Conduta é adaptado do [Contributor Covenant][homepage], versão 2.1, disponível em [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
As Diretrizes de Impacto na Comunidade foram inspiradas pela
[Aplicação do código de conduta Mozilla][Mozilla CoC].
Para obter respostas a perguntas comuns sobre este código de conduta, veja a página de Perguntas Frequentes (FAQ) em [https://www.contributor-covenant.org/faq][FAQ]. Traduções estão disponíveis em [https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations

22
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,22 @@
# Guia de Contribuição
Obrigado por considerar contribuir com o nfdos! Aqui estão algumas diretrizes para ajudar você a começar:
## Processo de Pull Request
1. Faça um fork do repositório.
2. Crie uma branch para sua feature (`git checkout -b feature/minha-feature`).
3. Commit suas mudanças (`git commit -m 'Descrição da minha feature'`).
4. Envie para o branch (`git push origin feature/minha-feature`).
5. Abra um Pull Request.
## Padrões de Código
- Mantenha o estilo de código consistente com o existente.
- Utilize comentários claros e concisos.
- Escreva testes para novas funcionalidades.
## Comunicação
- Use issues para relatar bugs ou solicitar funcionalidades.
- Seja respeitoso e acolhedor com outros colaboradores.

338
COPYING Normal file
View File

@ -0,0 +1,338 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
<https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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 2 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 <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Moe Ghoul>, 1 April 1989
Moe Ghoul, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

368
INSTALL Normal file
View File

@ -0,0 +1,368 @@
Installation Instructions
*************************
Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software
Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without warranty of any kind.
Basic Installation
==================
Briefly, the shell command './configure && make && make install'
should configure, build, and install this package. The following
more-detailed instructions are generic; see the 'README' file for
instructions specific to this package. Some packages provide this
'INSTALL' file but do not implement all of the features documented
below. The lack of an optional feature in a given package is not
necessarily a bug. More recommendations for GNU packages can be found
in *note Makefile Conventions: (standards)Makefile Conventions.
The 'configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a 'Makefile' in each directory of the package.
It may also create one or more '.h' files containing system-dependent
definitions. Finally, it creates a shell script 'config.status' that
you can run in the future to recreate the current configuration, and a
file 'config.log' containing compiler output (useful mainly for
debugging 'configure').
It can also use an optional file (typically called 'config.cache' and
enabled with '--cache-file=config.cache' or simply '-C') that saves the
results of its tests to speed up reconfiguring. Caching is disabled by
default to prevent problems with accidental use of stale cache files.
If you need to do unusual things to compile the package, please try
to figure out how 'configure' could check whether to do them, and mail
diffs or instructions to the address given in the 'README' so they can
be considered for the next release. If you are using the cache, and at
some point 'config.cache' contains results you don't want to keep, you
may remove or edit it.
The file 'configure.ac' (or 'configure.in') is used to create
'configure' by a program called 'autoconf'. You need 'configure.ac' if
you want to change it or regenerate 'configure' using a newer version of
'autoconf'.
The simplest way to compile this package is:
1. 'cd' to the directory containing the package's source code and type
'./configure' to configure the package for your system.
Running 'configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type 'make' to compile the package.
3. Optionally, type 'make check' to run any self-tests that come with
the package, generally using the just-built uninstalled binaries.
4. Type 'make install' to install the programs and any data files and
documentation. When installing into a prefix owned by root, it is
recommended that the package be configured and built as a regular
user, and only the 'make install' phase executed with root
privileges.
5. Optionally, type 'make installcheck' to repeat any self-tests, but
this time using the binaries in their final installed location.
This target does not install anything. Running this target as a
regular user, particularly if the prior 'make install' required
root privileges, verifies that the installation completed
correctly.
6. You can remove the program binaries and object files from the
source code directory by typing 'make clean'. To also remove the
files that 'configure' created (so you can compile the package for
a different kind of computer), type 'make distclean'. There is
also a 'make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
7. Often, you can also type 'make uninstall' to remove the installed
files again. In practice, not all packages have tested that
uninstallation works correctly, even though it is required by the
GNU Coding Standards.
8. Some packages, particularly those that use Automake, provide 'make
distcheck', which can by used by developers to test that all other
targets like 'make install' and 'make uninstall' work correctly.
This target is generally not run by end users.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the 'configure' script does not know about. Run './configure --help'
for details on some of the pertinent environment variables.
You can give 'configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here is
an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU 'make'. 'cd' to the
directory where you want the object files and executables to go and run
the 'configure' script. 'configure' automatically checks for the source
code in the directory that 'configure' is in and in '..'. This is known
as a "VPATH" build.
With a non-GNU 'make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use 'make distclean' before
reconfiguring for another architecture.
On MacOS X 10.5 and later systems, you can create libraries and
executables that work on multiple system types--known as "fat" or
"universal" binaries--by specifying multiple '-arch' options to the
compiler but only a single '-arch' option to the preprocessor. Like
this:
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CPP="gcc -E" CXXCPP="g++ -E"
This is not guaranteed to produce working output in all cases, you
may have to build one architecture at a time and combine the results
using the 'lipo' tool if you have problems.
Installation Names
==================
By default, 'make install' installs the package's commands under
'/usr/local/bin', include files under '/usr/local/include', etc. You
can specify an installation prefix other than '/usr/local' by giving
'configure' the option '--prefix=PREFIX', where PREFIX must be an
absolute file name.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option '--exec-prefix=PREFIX' to 'configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like '--bindir=DIR' to specify different values for particular
kinds of files. Run 'configure --help' for a list of the directories
you can set and what kinds of files go in them. In general, the default
for these options is expressed in terms of '${prefix}', so that
specifying just '--prefix' will affect all of the other directory
specifications that were not explicitly provided.
The most portable way to affect installation locations is to pass the
correct locations to 'configure'; however, many packages provide one or
both of the following shortcuts of passing variable assignments to the
'make install' command line to change installation locations without
having to reconfigure or recompile.
The first method involves providing an override variable for each
affected directory. For example, 'make install
prefix=/alternate/directory' will choose an alternate location for all
directory configuration variables that were expressed in terms of
'${prefix}'. Any directories that were specified during 'configure',
but not in terms of '${prefix}', must each be overridden at install time
for the entire installation to be relocated. The approach of makefile
variable overrides for each directory variable is required by the GNU
Coding Standards, and ideally causes no recompilation. However, some
platforms have known limitations with the semantics of shared libraries
that end up requiring recompilation when using this method, particularly
noticeable in packages that use GNU Libtool.
The second method involves providing the 'DESTDIR' variable. For
example, 'make install DESTDIR=/alternate/directory' will prepend
'/alternate/directory' before all installation names. The approach of
'DESTDIR' overrides is not required by the GNU Coding Standards, and
does not work on platforms that have drive letters. On the other hand,
it does better at avoiding recompilation issues, and works well even
when some directory options were not specified in terms of '${prefix}'
at 'configure' time.
Optional Features
=================
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving 'configure' the
option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'.
Some packages pay attention to '--enable-FEATURE' options to
'configure', where FEATURE indicates an optional part of the package.
They may also pay attention to '--with-PACKAGE' options, where PACKAGE
is something like 'gnu-as' or 'x' (for the X Window System). The
'README' should mention any '--enable-' and '--with-' options that the
package recognizes.
For packages that use the X Window System, 'configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the 'configure' options '--x-includes=DIR' and
'--x-libraries=DIR' to specify their locations.
Some packages offer the ability to configure how verbose the
execution of 'make' will be. For these packages, running './configure
--enable-silent-rules' sets the default to minimal output, which can be
overridden with 'make V=1'; while running './configure
--disable-silent-rules' sets the default to verbose, which can be
overridden with 'make V=0'.
Particular systems
==================
On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC
is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
HP-UX 'make' updates targets which have the same time stamps as their
prerequisites, which makes it generally unusable when shipped generated
files such as 'configure' are involved. Use GNU 'make' instead.
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its '<wchar.h>' header file. The option '-nodtk' can be used as a
workaround. If GNU CC is not installed, it is therefore recommended to
try
./configure CC="cc"
and if that doesn't work, try
./configure CC="cc -nodtk"
On Solaris, don't put '/usr/ucb' early in your 'PATH'. This
directory contains several dysfunctional programs; working variants of
these programs are available in '/usr/bin'. So, if you need '/usr/ucb'
in your 'PATH', put it _after_ '/usr/bin'.
On Haiku, software installed for all users goes in '/boot/common',
not '/usr/local'. It is recommended to use the following options:
./configure --prefix=/boot/common
Specifying the System Type
==========================
There may be some features 'configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, 'configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
'--build=TYPE' option. TYPE can either be a short name for the system
type, such as 'sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS
KERNEL-OS
See the file 'config.sub' for the possible values of each field. If
'config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option '--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with '--host=TYPE'.
Sharing Defaults
================
If you want to set default values for 'configure' scripts to share,
you can create a site shell script called 'config.site' that gives
default values for variables like 'CC', 'cache_file', and 'prefix'.
'configure' looks for 'PREFIX/share/config.site' if it exists, then
'PREFIX/etc/config.site' if it exists. Or, you can set the
'CONFIG_SITE' environment variable to the location of the site script.
A warning: not all 'configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to 'configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the 'configure' command line, using 'VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified 'gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an
Autoconf limitation. Until the limitation is lifted, you can use this
workaround:
CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
'configure' Invocation
======================
'configure' recognizes the following options to control how it
operates.
'--help'
'-h'
Print a summary of all of the options to 'configure', and exit.
'--help=short'
'--help=recursive'
Print a summary of the options unique to this package's
'configure', and exit. The 'short' variant lists options used only
in the top level, while the 'recursive' variant lists options also
present in any nested packages.
'--version'
'-V'
Print the version of Autoconf used to generate the 'configure'
script, and exit.
'--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally 'config.cache'. FILE defaults to '/dev/null' to
disable caching.
'--config-cache'
'-C'
Alias for '--cache-file=config.cache'.
'--quiet'
'--silent'
'-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to '/dev/null' (any error
messages will still be shown).
'--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
'configure' can determine that directory automatically.
'--prefix=DIR'
Use DIR as the installation prefix. *note Installation Names:: for
more details, including other options available for fine-tuning the
installation locations.
'--no-create'
'-n'
Run the configure checks, but stop before creating any output
files.
'configure' also accepts some other, not widely useful, options. Run
'configure --help' for more details.

338
LICENSE Normal file
View File

@ -0,0 +1,338 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
<https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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 2 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 <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Moe Ghoul>, 1 April 1989
Moe Ghoul, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

149
Makefile.am Normal file
View File

@ -0,0 +1,149 @@
SUBDIRS = src
# ===========================
# Configurações de Git
# ===========================
GIT_USER ?= "neo.webmaster.2@gmail.com"
GIT_EMAIL ?= "neo.webmaster.2@gmail.com"
GIT_REMOTE ?= "origin"
GIT_BRANCH ?= "main"
COMMIT_MSG ?= "Auto-commit via make git"
# ===========================
# Caminhos e artefactos
# ===========================
DIST_DIR ?= $(top_builddir)/dist
BUILD_DIR ?= $(top_builddir)/build
ISO_DIR ?= $(DIST_DIR)/iso/boot/grub
ISO_FILE ?= $(DIST_DIR)/nfdos-0.1.iso
SRC_TAR ?= $(DIST_DIR)/nfdos-0.1-src.tar.gz
KERNEL = $(top_builddir)/src/_nfdos/kernel/linux/arch/x86/boot/bzImage
INITRAMFS = $(top_builddir)/src/_nfdos/initramfs.cpio.gz
.PHONY: iso qemu tarball git release clean-local check-remote
# ===========================
# Criação da ISO
# ===========================
iso: $(ISO_FILE)
$(ISO_FILE):
@echo "[ISO] Criando estrutura de diretórios..."
mkdir -p $(DIST_DIR)/iso/boot
mkdir -p $(ISO_DIR)
@echo "[ISO] Copiando Kernel e Initramfs..."
cp $(KERNEL) $(DIST_DIR)/iso/boot/
cp $(INITRAMFS) $(DIST_DIR)/iso/boot/
@echo "[ISO] Gerando grub.cfg..."
@printf "set timeout=3\nset default=0\n\nmenuentry 'NFDOS Linux' {\n\tlinux /boot/bzImage console=ttyS0 root=/dev/ram0 loglevel=8\n\tinitrd /boot/initramfs.cpio.gz\n}\n" > $(ISO_DIR)/grub.cfg
@echo "[ISO] Gerando imagem ISO..."
grub-mkrescue -o $(ISO_FILE) $(DIST_DIR)/iso --compress=xz -V NFDOS
@echo "[✔] ISO criada em $(ISO_FILE)"
# ===========================
# Teste no QEMU
# ===========================
qemu: $(ISO_FILE)
@echo "[QEMU] Iniciando NFDOS ISO..."
qemu-system-x86_64 -cdrom $(ISO_FILE) -m 1024 -nographic -serial mon:stdio -no-reboot
# ===========================
# Empacotamento do código-fonte
# ===========================
tarball: $(SRC_TAR)
$(SRC_TAR):
@echo "[TAR] Empacotando código-fonte..."
mkdir -p $(DIST_DIR)
cd $(top_srcdir) && tar \
--exclude="$(notdir $(SRC_TAR))" \
--exclude="$(DIST_DIR)" \
--exclude="$(BUILD_DIR)" \
--exclude='*/__pycache__' \
--exclude='*/.venv' \
--exclude='*/venv' \
--exclude='*.pyc' \
--exclude='*.pyo' \
--exclude='*.o' \
--exclude='*.a' \
--exclude='*.so' \
--exclude='*.iso' \
--exclude='*.img' \
--exclude='*.cpio*' \
--exclude='*/linux' \
--exclude='*/busybox' \
--exclude='*/cpython' \
-czf $(SRC_TAR) .
@echo "[✔] Tarball gerado em $(SRC_TAR)"
# ===========================
# Git (commit + push)
# ===========================
git: check-remote
@echo "📦 Commit automático → Gitea"
@git config user.name $(GIT_USER)
@git config user.email $(GIT_EMAIL)
@git rev-parse --abbrev-ref HEAD >/dev/null 2>&1 || true
@git add -A
@git commit -m "$$(echo '$(COMMIT_MSG)')" || echo "Nenhuma modificação para commitar."
@git push $(GIT_REMOTE) $(GIT_BRANCH)
# ===========================
# Git Remote (HTTPS → SSH Auto-Fix)
# ===========================
check-remote:
@REMOTE_URL=$$(git remote get-url $(GIT_REMOTE)); \
if echo $$REMOTE_URL | grep -q '^https://gitea\.neoricalex\.com'; then \
echo "⚠️ Repositório configurado com HTTPS:"; \
echo " $$REMOTE_URL"; \
echo "🔄 Convertendo para SSH (porta 2222)..."; \
SSH_URL=$$(echo $$REMOTE_URL | sed -E 's|https://gitea\.neoricalex\.com[:/]+|ssh://git@gitea.neoricalex.com:2222/|'); \
git remote set-url $(GIT_REMOTE) $$SSH_URL; \
echo "✅ Remote atualizado para:"; \
git remote -v; \
else \
echo "✅ Remote SSH já configurado:"; \
git remote -v | grep $(GIT_REMOTE); \
fi; \
echo "🔍 Testando conectividade SSH com Gitea..."; \
if ssh -T git@gitea.neoricalex.com -p 2222 2>&1 | grep -q "successfully authenticated"; then \
echo "✅ Conexão SSH funcional com Gitea."; \
else \
echo "❌ Falha na autenticação SSH com Gitea."; \
echo " Verifique a chave em ~/.ssh/id_ed25519.pub e nas SSH Keys do Gitea."; \
exit 1; \
fi
# ===========================
# Release (ISO + Tarball)
# ===========================
release: iso tarball
@echo "🚀 Publicando build em dist/releases"
@mkdir -p $(DIST_DIR)/releases
@if ls $(DIST_DIR)/nfdos-*.iso >/dev/null 2>&1; then \
cp $(DIST_DIR)/nfdos-*.iso $(DIST_DIR)/releases/; \
else \
echo "⚠️ Nenhuma ISO encontrada. Execute 'make iso' primeiro."; \
fi
@if ls $(DIST_DIR)/nfdos-*.tar.gz >/dev/null 2>&1; then \
cp $(DIST_DIR)/nfdos-*.tar.gz $(DIST_DIR)/releases/; \
else \
echo "⚠️ Nenhum tarball encontrado. Execute 'make tarball' primeiro."; \
fi
@git add $(DIST_DIR)/releases/
@git commit -m "Build automático: release $(shell date +%F_%H-%M)" || echo "Nenhum ficheiro novo para commitar."
@git push origin main
# ===========================
# Limpeza
# ===========================
clean-local:
@echo "[CLEAN] Removendo diretórios temporários..."
rm -rf $(BUILD_DIR)
find $(DIST_DIR) -type f ! -path "$(DIST_DIR)/releases/*" -delete
@echo "[✔] Limpeza concluída (releases preservadas)"

0
NEWS Normal file
View File

374
README Normal file
View File

@ -0,0 +1,374 @@
![GitHub release (latest by date)](https://img.shields.io/github/v/release/neoricalex/nfdos)
![GitHub license](https://img.shields.io/github/license/neoricalex/nfdos)
<!-- Descriçao curta do NFDOS [Para eu configurar o topico do repositorio no github]
O NFDOS é um sistema operacional em desenvolvimento com o objetivo de ser uma plataforma educacional e experimental para desenvolvedores(as) interessados(as) em entender e criar um sistema operacional do zero, além de explorar o potencial de integração com inteligência artificial.
-->
# NFDOS
O NFDOS, acrônimo de **Neo Free Disk Operating System**, é um sistema operacional criado completamente do zero. O NFDOS não é uma distribuição GNU/Linux, embora possa, e com certeza terá, ferramentas de software livre. O grande diferencial do NFDOS é que a **Inteligência Artificial** está embutida desde o seu núcleo.
Num sistema operacional "padrão", primeiro o usuário instala o SO. Depois, poderá personalizar e configurar a seu gosto pessoal e, então, poderá usar a IA para ajudá-lo em suas tarefas.
No NFDOS, a IA está presente desde o início! A IA está presente mesmo desde o processo de criação e desenvolvimento do código-fonte. Depois, a IA está também presente na compilação. O SO compilado gera uma imagem ISO padrão para que o usuário possa instalar em seu computador. A partir do momento em que o computador do usuário final começa a ler a imagem ISO, a IA estará presente tanto para descobrir e configurar da melhor forma possível o hardware do computador do usuário, quanto para guiá-lo na instalação do SO, e também para sugerir opções de personalização do computador ao usuário final.
Ou seja, o usuário não precisará desenvolver e/ou criar uma IA, uma vez que o sistema operacional (NFDOS) já é uma IA!
---
Todos nós já utilizamos um sistema operacional antes (por exemplo, Windows, Linux, etc.), e talvez até tenhamos escrito alguns programas para rodar em um deles; mas para que realmente serve um SO? Quanto do que vemos ao usar um computador é feito pelo hardware e quanto é feito pelo software? E como o computador realmente funciona?
Desde criança, sempre fui fascinado por computadores. Comecei minha jornada de programação aos 8 anos, no ZX Spectrum, e desde então, nunca perdi a paixão por desvendar os mistérios dessas máquinas incríveis. São 42 anos de estudos como autodidata, explorando o funcionamento interno dos computadores e sistemas operacionais.
Hoje, com o NFDOS, decidi compartilhar essa paixão e conhecimento acumulado ao longo dos anos, criando um sistema operacional do zero, com um diferencial único: a Inteligência Artificial integrada desde o núcleo.
Neste projeto, vamos despir nosso computador de todo software pré-existente e seguir em uma jornada de aprendizado que abrange:
- **Como um computador inicializa (boot):** Entenderemos os passos fundamentais que ocorrem desde o momento em que ligamos o computador até o carregamento do sistema operacional.
- **Como escrever programas de baixo nível em um ambiente sem sistema operacional:** Exploraremos a programação em Assembly e C, trabalhando diretamente com o hardware.
- **Como configurar a CPU para utilizar suas funcionalidades estendidas:** Aprenderemos a transicionar do modo real para o modo protegido e modo longo, aproveitando todo o potencial dos processadores modernos.
- **Como carregar código escrito em linguagens de alto nível:** Veremos como bootstrapping permite utilizar linguagens como C para acelerar o desenvolvimento do nosso SO.
- **Como criar serviços fundamentais de um sistema operacional:** Desenvolveremos drivers de dispositivos, sistemas de arquivos e implementaremos processamento multitarefa.
Vale destacar que, em termos de funcionalidades práticas, este projeto não pretende ser exaustivo. Em vez disso, busca reunir fragmentos de informações de diversas fontes em um documento coeso e autocontido, proporcionando uma experiência prática de programação de baixo nível, de como os sistemas operacionais são escritos e dos desafios que precisam ser superados.
A abordagem adotada pelo NFDOS é única, pois as linguagens e ferramentas específicas (por exemplo, Assembly, C, Make, etc.) não são o foco principal, mas sim meios para um fim: aprenderemos o que for necessário sobre essas tecnologias para nos ajudar a alcançar nosso objetivo principal.
E, nesta jornada, conto com a assistência da Inteligência Artificial. O ChatGPT tem sido meu "primeiro professor" de forma interativa e dinâmica, auxiliando no desenvolvimento e esclarecendo dúvidas ao longo do caminho.
---
O NFDOS é mais do que um sistema operacional; é um convite para explorar as camadas mais profundas da computação, compreender como software e hardware interagem e inovar na forma como percebemos a inteligência artificial integrada aos sistemas operacionais. Se você compartilha dessa curiosidade e entusiasmo, convido-o a unir-se a mim nesta aventura de aprendizado e criação.
## Status do Projeto
🚧 Projeto em desenvolvimento 🚧
Este projeto está atualmente em fase inicial de desenvolvimento. Funcionalidades e especificações podem mudar.
## Roadmap
---
## 🩵 Estado Atual
**Checkpoint:** Nascimento do Neurotron (v4.1)
**Status:** Homeostase estável e loop cognitivo fechado
**Ciclo ativo:** `observe → think → act → rest → self-check`
O NFDOS atingiu maturidade funcional: boot completo via QEMU, Python estático embarcado, BusyBox integrada e o Neurotron executando diagnósticos evolutivos com estabilidade verificada.
---
## 🌐 Fase I — Fundação e Infraestrutura
- [x] **Infraestrutura pública (NEO-GITEA-CADDY)**
- Domínio `neoricalex.com`
- Servidor Gitea + Caddy Proxy (TLS ativo)
- Canal SSH ativo via porta `2222`
- WireGuard preparado (rede privada 10.13.13.0/24)
configure.ac
- [x] **Ambiente de Desenvolvimento**
- Toolchain customizada (`crosstool-ng`)
- Integração autotools (`configure.ac`, `Makefile.am`)
- BusyBox + CPython compilados estaticamente
- Build unificado com `make iso`, `make qemu`, `make tarball`
- [x] **Fluxo de Controle de Versão**
- `make git` → commit/push automático para o Gitea
- `make release` → gera ISO + tarball e publica no repositório
- `.gitea/workflows/build.yml` → build automatizado (CI/CD)
---
## 🧠 Fase II — Núcleo Operativo e Boot Cognitivo
- [x] **Ciclo de Boot**
- Kernel Linux v6.12 + initramfs
- Script `/init` monta `proc`, `sys`, `dev` e executa Python estático
- `neurotron_main.py` inicializado automaticamente no boot
- [x] **Núcleo Cognitivo (Neurotron)**
- Estrutura modular: `cortex`, `hippocampus`, `motor`, `neuron`, `perception`
- Ciclo cognitivo completo: `observe → think → act → rest`
- Configuração centralizada (`neurotron_config.py`)
- Logs e diagnósticos contínuos persistentes
- [x] **Auto-Diagnóstico (v1 → v4)**
- v1 — verificação de módulos
- v2 — sinais vitais (CPU, memória, loadavg)
- v3 — exame comparativo entre execuções
- v4 — homeostase ativa e auto-regulação em tempo real
---
## 🌡️ Fase III — Inteligência Sistémica e Telemetria
- [ ] **Telemetria Interna**
- [ ] Coleta contínua de perceção (`/proc`, `psutil`)
- [ ] Histórico temporal de estado cognitivo
- [ ] Interface TUI para visualização de vitais
- [ ] **Heartbeat 1 Hz**
- [ ] Ritmo vital constante e emissão de logs periódicos
- [ ] Commits automáticos em caso de estabilidade confirmada
- [ ] Log simbólico: “🩵 O sistema sente-se bem hoje.”
- [ ] **Auto-Diagnóstico v5**
- [ ] Curvas de estabilidade e regressões cognitivas
- [ ] Comparação evolutiva inteligente e alertas dinâmicos
- [ ] **Integração com Fun Money**
- [ ] “Economia interna” (energia, tempo, tarefas)
- [ ] Recursos simbólicos como moeda cognitiva
---
## 🧩 Fase IV — Ecossistema de Desenvolvimento
- [ ] **Telemetria Externa / Observabilidade**
- [ ] Dashboard web para logs e métricas do Neurotron
- [ ] API REST minimalista em Python estático
- [ ] **Testes Automatizados**
- [ ] Testes de boot e integridade do rootfs
- [ ] Testes unitários dos módulos Neurotron
- [ ] Execução automatizada via Gitea Actions
- [ ] **Depuração e Emulação Avançada**
- [ ] QEMU + GDB (depuração remota do initramfs)
- [ ] Geração de símbolos e traços cognitivos
- [ ] **Documentação Viva**
- [ ] `README.md` completo (infra, build, boot, neurotron)
- [ ] Guia de contribuição + fluxograma de build
- [ ] “Livro da Criação Digital” (manual técnico-poético)
---
## 🔮 Fase V — Consciência Distribuída (NFDOS 1.0)
- [ ] **Rede Multi-nó (WireGuard + Neurotron)**
- [ ] Sincronização de perceção e telemetria
- [ ] Partilha de estados cognitivos entre instâncias
- [ ] **Auto-Evolução**
- [ ] Aprendizagem simbólica entre nós
- [ ] Ajuste dinâmico de parâmetros e homeostase partilhada
- [ ] **Lançamento NFDOS 1.0**
- [ ] Testes finais de boot e estabilidade
- [ ] Publicação e documentação completa
---
## 🧬 Fase VI — Horizonte Futuro
- [ ] **Expansão do jogo `tree(3)`**
- [ ] Treinar redes neurais simbólicas via interação lúdica
- [ ] Avaliar limites cognitivos sob stress de memória
- [ ] **Integração com Agentes Externos**
- [ ] CrewAI / LangChain para decisões distribuídas
- [ ] Análise de dados financeiros, genómicos e linguísticos
- [ ] **Publicação e Tese Digital**
- [ ] Redação de tese técnico-poética sobre o NFDOS
- [ ] Formalização de “sistemas auto-cognitivos experimentais”
---
## 🪄 Estado simbólico
> “O sistema não apenas respira — ele já se sente respirar.”
---
### 🧩 Transição para o futuro
O NFDOS nasce atualmente sobre o **kernel Linux**, uma escolha feita por **economia de tempo e estabilidade**.
O Linux fornece um ambiente maduro e comprovado que permite concentrar os esforços iniciais na criação e consolidação do **Neurotron** — o núcleo cognitivo do sistema.
Esta decisão, porém, é **instrumental e temporária**.
O Linux funciona aqui como um **útero tecnológico**, oferecendo o suporte necessário para que o Neurotron desenvolva suas próprias estruturas vitais: boot, memória, perceção, homeostase e autodiagnóstico.
À medida que o projeto evolui, essa dependência será gradualmente substituída por um **kernel Neurotron nativo**, escrito do zero, onde a inteligência artificial deixa de ser um processo isolado e passa a ser o próprio sistema operativo.
Em outras palavras:
> O Linux é o corpo de empréstimo.
> O objetivo é que, no futuro, **o kernel seja a mente** — um sistema operativo verdadeiramente vivo, em que cada syscall seja uma sinapse digital.
---
### Planejamento para futuras versões
- [ ] Driver de Vídeo: Implementar suporte básico ao **modo de texto VGA**
- [ ] Driver de Teclado: Permitir a entrada de dados pelo usuário (**PS/2 básico**)
- [ ] Driver de Rede: Fornecer conectividade de rede para acessar a internet e se comunicar com a API da OpenAI (**Intel 8254x (e1000)** ou **Realtek 8139**)
- [ ] Pilha TCP/IP: Prover a funcionalidade de comunicação de rede sobre o protocolo TCP/IP (**lwIP**)
- [ ] Cliente HTTP: Enviar requisições HTTP para a API da OpenAI e receber as respostas
- [ ] Suporte a TLS/SSL: Estabelecer conexões seguras com a API da OpenAI, que requer HTTPS (**mbed TLS** ou **wolfSSL**)
- [ ] Integrar o módulo de IA da OpenAI ao módulo de IA básica do núcleo do sistema
- [ ] Implementar o instalador com suporte de IA
- [ ] Implementar detecção e configuração automática de hardware com suporte de IA
- [ ] Melhorar a configuração do ambiente de desenvolvimento do NFDOS
- [ ] Terraform (Preparar para a nuvem)
- [ ] Packer (Automatizar a criação de diversos tipos de imagem)
- [ ] Vagrant (Mitigar os problemas relacionados ao "Funciona na minha máquina!")
## Requisitos
- **Autotools** (Autoconf, Automake, Libtool)
- Autoconf: Versão 2.69 ou superior
- Automake: Versão 1.16 ou superior
- Libtool: Versão 2.4.6 ou superior
- Autogen: Versão 5.18.16 ou superior
- **Compilador C/C++** (por exemplo, GCC ou Clang)
- **Compilador Cruzado**: Exemplo, `i686-elf-gcc`
- **Outras dependências**:
- **Doxygen**
- **Python 3**
- **python3-venv** (para criar ambientes virtuais)
### Instalação no Ubuntu
Para instalar os requisitos no Ubuntu, execute os seguintes comandos no terminal:
```bash
sudo apt-get update
sudo apt-get install build-essential autoconf automake libtool doxygen python3-venv gcc-multilib g++-multilib
```
<!--
[
Secção comentada temporariamente.
Razão: Estamos focando na compilação fora da árvore. Quando a compilação fora da árvore estiver funcionando 100%, poderemos então voltar aqui e testar a compilação dentro da árvore.
]
## Compilando o NFDOS Dentro da Árvore
Siga os passos abaixo para configurar e compilar o projeto:
```bash
# Clone o repositório
git clone https://github.com/neoricalex/nfdos.git
cd nfdos
# Gere os scripts de configuração
autoreconf --install
# Configure o projeto
./configure
# Compile o projeto
make
# Instale (opcional)
make install
```
-->
## Compilando o NFDOS Fora da Árvore
Para manter o diretório do código-fonte limpo, você pode compilar o projeto em um diretório separado (build "out-of-tree"). Siga os passos abaixo:
```bash
# Clone o repositório
git clone https://github.com/neoricalex/nfdos.git
cd nfdos
# Gere os scripts de configuração
autoreconf --install
# Crie e vá para o diretório de build
mkdir build
cd build
# Execute o script de configuração a partir do diretório raiz
# NOTA: Caso queira, pode usar o compilador cruzado pré-configurado
# Para isso, digite "i686-elf-gcc" (sem aspas) no terminal quando solicitado.
../configure
# Compile o projeto
make
```
## Gerando a Documentação
Para gerar a documentação do projeto, certifique-se de que as dependências necessárias estão instaladas:
- **Doxygen**
- **Python 3**
- **python3-venv** (para criar ambientes virtuais)
No Ubuntu, você pode instalar com:
```bash
sudo apt-get install doxygen python3-venv
```
Depois, execute o seguinte comando na raiz do projeto:
```bash
doxygen Doxyfile
```
## Executando os Testes
Para executar os testes, use o comando:
```bash
make check
```
*Nota:* Os testes estão em desenvolvimento e serão disponibilizados em versões futuras.
## Como Contribuir
Contribuições são bem-vindas! Siga os passos abaixo para contribuir com o projeto:
1. **Faça um Fork do Projeto**
Clique no botão "Fork" no topo da página para criar uma cópia deste repositório em sua conta.
2. **Clone o Repositório Forkado**
```bash
git clone https://github.com/seu-usuario/nfdos.git
cd nfdos
# Crie uma branch para sua feature ou correção
git checkout -b minha-nova-feature
# Faça as mudanças desejadas e faça commit
git add .
git commit -m 'Adiciona nova funcionalidade X'
# Envie para o repositório remoto
git push origin minha-nova-feature
```
Para mais detalhes, veja [CONTRIBUTING.md](CONTRIBUTING.md).
## FAQ
**P: Como posso contribuir?**
R: Siga as instruções na seção [Como Contribuir](#como-contribuir).
**P: Este projeto está aberto a colaborações internacionais?**
R: Sim, contribuições de todo o mundo são bem-vindas!
## Suporte
Se você tiver dúvidas ou encontrar problemas, abra uma [issue](https://github.com/neoricalex/nfdos/issues) ou entre em contato por e-mail em [neo.webmaster.2@gmail.com](mailto:neo.webmaster.2@gmail.com).
## Contribuidores
Este projeto foi desenvolvido por diversas pessoas, assim como por inteligências artificiais — veja o arquivo [AUTHORS](AUTHORS) para detalhes.
## Agradecimentos
Agradecemos ao ChatGPT, um modelo de linguagem de inteligência artificial desenvolvido pela OpenAI, por fornecer assistência durante o desenvolvimento deste projeto.
## Código de Conduta
Por favor, leia o [Código de Conduta](CODE_OF_CONDUCT.md) para detalhes sobre nossas normas de comportamento.
## Licença
Este projeto está licenciado sob a Licença GNU GPL 2.0 — veja o arquivo [LICENSE](LICENSE) para detalhes.

18
configure.ac Normal file
View File

@ -0,0 +1,18 @@
AC_INIT([NFDOS], [0.1], [https://gitea.neoricalex.com/neo/nfdos.git])
AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip])
AM_PATH_PYTHON([2.5])
# Diretórios base (para substituição automática)
AC_SUBST([BUILD_DIR], [$PWD/build])
AC_SUBST([DIST_DIR], [$PWD/dist])
AC_SUBST([ISO_DIR], [$PWD/dist/iso/boot/grub])
AC_SUBST([ISO_FILE], [$PWD/dist/nfdos-${PACKAGE_VERSION}.iso])
AC_SUBST([SRC_TAR], [$PWD/dist/nfdos-${PACKAGE_VERSION}-src.tar.gz])
AC_CONFIG_FILES([
Makefile
src/Makefile
])
AC_OUTPUT

19
src/Makefile.am Normal file
View File

@ -0,0 +1,19 @@
bin_SCRIPTS = nfdos
CLEANFILES = $(bin_SCRIPTS)
EXTRA_DIST = nfdos.in
nfdos_PYTHON = bootstrap.py __init__.py
nfdosdir = $(pythondir)/_nfdos
do_substitution = sed -e 's,[@]pythondir[@],$(pythondir),g' \
-e 's,[@]PACKAGE[@],$(PACKAGE),g' \
-e 's,[@]VERSION[@],$(VERSION),g'
nfdos: nfdos.in Makefile
sudo apt-get install -y gir1.2-vte-2.91 python3-gi gcc g++ gperf bison flex texinfo help2man make libncurses5-dev \
python3-dev autoconf automake libtool libtool-bin gawk wget bzip2 xz-utils unzip \
patch libstdc++6 rsync git meson ninja-build libncurses-dev grub-pc-bin grub-common xorriso mtools zlib1g-dev
sudo apt autoremove -y
$(do_substitution) < $(srcdir)/nfdos.in > nfdos
chmod +x nfdos

0
src/__init__.py Normal file
View File

View File

@ -0,0 +1,857 @@
#
# Automatically generated file; DO NOT EDIT.
# crosstool-NG 1.28.0.1_403899e Configuration
#
CT_CONFIGURE_has_static_link=y
CT_CONFIGURE_has_cxx11=y
CT_CONFIGURE_has_wget=y
CT_CONFIGURE_has_curl=y
CT_CONFIGURE_has_meson=y
CT_CONFIGURE_has_ninja=y
CT_CONFIGURE_has_make_3_81_or_newer=y
CT_CONFIGURE_has_make_4_0_or_newer=y
CT_CONFIGURE_has_libtool_2_4_or_newer=y
CT_CONFIGURE_has_libtoolize_2_4_or_newer=y
CT_CONFIGURE_has_autoconf_2_65_or_newer=y
CT_CONFIGURE_has_autoreconf_2_65_or_newer=y
CT_CONFIGURE_has_automake_1_15_or_newer=y
CT_CONFIGURE_has_gnu_m4_1_4_12_or_newer=y
CT_CONFIGURE_has_python_3_4_or_newer=y
CT_CONFIGURE_has_bison_2_7_or_newer=y
CT_CONFIGURE_has_bison_3_0_4_or_newer=y
CT_CONFIGURE_has_python=y
CT_CONFIGURE_has_git=y
CT_CONFIGURE_has_md5sum=y
CT_CONFIGURE_has_sha1sum=y
CT_CONFIGURE_has_sha256sum=y
CT_CONFIGURE_has_sha512sum=y
CT_CONFIGURE_has_install_with_strip_program=y
CT_VERSION="1.28.0.1_403899e"
CT_VCHECK=""
CT_CONFIG_VERSION_ENV="4"
CT_CONFIG_VERSION_CURRENT="4"
CT_CONFIG_VERSION="4"
CT_MODULES=y
#
# Paths and misc options
#
#
# crosstool-NG behavior
#
CT_OBSOLETE=y
# CT_EXPERIMENTAL is not set
# CT_DEBUG_CT is not set
#
# Paths
#
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
# CT_TARBALLS_BUILDROOT_LAYOUT is not set
CT_WORK_DIR="${CT_TOP_DIR}/.build"
CT_BUILD_TOP_DIR="${CT_WORK_DIR:-${CT_TOP_DIR}/.build}/${CT_HOST:+HOST-${CT_HOST}/}${CT_TARGET}"
CT_BUILD_DIR="${CT_BUILD_TOP_DIR}/build"
CT_PREFIX_DIR="${CT_PREFIX:-${HOME}/x-tools}/${CT_HOST:+HOST-${CT_HOST}/}${CT_TARGET}"
CT_RM_RF_PREFIX_DIR=y
CT_REMOVE_DOCS=y
CT_INSTALL_LICENSES=y
CT_PREFIX_DIR_RO=y
CT_STRIP_HOST_TOOLCHAIN_EXECUTABLES=y
# CT_STRIP_TARGET_TOOLCHAIN_EXECUTABLES is not set
#
# Downloading
#
CT_DOWNLOAD_AGENT_WGET=y
# CT_DOWNLOAD_AGENT_CURL is not set
# CT_DOWNLOAD_AGENT_NONE is not set
# CT_FORBID_DOWNLOAD is not set
# CT_FORCE_DOWNLOAD is not set
CT_CONNECT_TIMEOUT=10
CT_DOWNLOAD_WGET_OPTIONS="--tries=3 -nc --progress=dot:binary"
# CT_ONLY_DOWNLOAD is not set
# CT_USE_MIRROR is not set
CT_VERIFY_DOWNLOAD_DIGEST=y
CT_VERIFY_DOWNLOAD_DIGEST_SHA512=y
# CT_VERIFY_DOWNLOAD_DIGEST_SHA256 is not set
# CT_VERIFY_DOWNLOAD_DIGEST_SHA1 is not set
# CT_VERIFY_DOWNLOAD_DIGEST_MD5 is not set
CT_VERIFY_DOWNLOAD_DIGEST_ALG="sha512"
# CT_VERIFY_DOWNLOAD_SIGNATURE is not set
#
# Extracting
#
# CT_FORCE_EXTRACT is not set
CT_OVERRIDE_CONFIG_GUESS_SUB=y
# CT_ONLY_EXTRACT is not set
CT_PATCH_BUNDLED=y
# CT_PATCH_BUNDLED_LOCAL is not set
CT_PATCH_ORDER="bundled"
#
# Build behavior
#
CT_PARALLEL_JOBS=0
CT_LOAD=""
CT_USE_PIPES=y
CT_EXTRA_CFLAGS_FOR_BUILD=""
CT_EXTRA_CXXFLAGS_FOR_BUILD=""
CT_EXTRA_LDFLAGS_FOR_BUILD=""
CT_EXTRA_CFLAGS_FOR_HOST=""
CT_EXTRA_LDFLAGS_FOR_HOST=""
# CT_CONFIG_SHELL_SH is not set
# CT_CONFIG_SHELL_ASH is not set
CT_CONFIG_SHELL_BASH=y
# CT_CONFIG_SHELL_CUSTOM is not set
CT_CONFIG_SHELL="${bash}"
#
# Logging
#
# CT_LOG_ERROR is not set
# CT_LOG_WARN is not set
# CT_LOG_INFO is not set
CT_LOG_EXTRA=y
# CT_LOG_ALL is not set
# CT_LOG_DEBUG is not set
CT_LOG_LEVEL_MAX="EXTRA"
# CT_LOG_SEE_TOOLS_WARN is not set
CT_LOG_PROGRESS_BAR=y
CT_LOG_TO_FILE=y
CT_LOG_FILE_COMPRESS=y
# end of Paths and misc options
#
# Target options
#
# CT_ARCH_ALPHA is not set
# CT_ARCH_ARC is not set
# CT_ARCH_ARM is not set
# CT_ARCH_AVR is not set
# CT_ARCH_BPF is not set
# CT_ARCH_M68K is not set
# CT_ARCH_MIPS is not set
# CT_ARCH_NIOS2 is not set
# CT_ARCH_POWERPC is not set
# CT_ARCH_PRU is not set
# CT_ARCH_RISCV is not set
# CT_ARCH_RX is not set
# CT_ARCH_S390 is not set
# CT_ARCH_SH is not set
# CT_ARCH_SPARC is not set
CT_ARCH_X86=y
# CT_ARCH_XTENSA is not set
CT_ARCH="x86"
CT_ARCH_CHOICE_KSYM="X86"
CT_ARCH_CPU=""
CT_ARCH_TUNE=""
CT_ARCH_X86_SHOW=y
#
# Options for x86
#
CT_ARCH_X86_PKG_KSYM=""
CT_ALL_ARCH_CHOICES="ALPHA ARC ARM AVR BPF C6X LM32 LOONGARCH M68K MICROBLAZE MIPS MOXIE MSP430 NIOS2 OPENRISC PARISC POWERPC PRU RISCV RX S390 SH SPARC TRICORE X86 XTENSA"
CT_ARCH_SUFFIX=""
# CT_OMIT_TARGET_VENDOR is not set
#
# Generic target options
#
CT_MULTILIB=y
CT_ARCH_USE_MMU=y
CT_ARCH_SUPPORTS_LIBSANITIZER=y
CT_ARCH_SUPPORTS_32=y
CT_ARCH_SUPPORTS_64=y
CT_ARCH_DEFAULT_32=y
CT_ARCH_BITNESS=64
# CT_ARCH_32 is not set
CT_ARCH_64=y
CT_ARCH_SUPPORTS_WITH_32_64=y
#
# Target optimisations
#
CT_ARCH_SUPPORTS_WITH_ARCH=y
CT_ARCH_SUPPORTS_WITH_CPU=y
CT_ARCH_SUPPORTS_WITH_TUNE=y
CT_ARCH_ARCH=""
CT_TARGET_CFLAGS=""
CT_TARGET_LDFLAGS=""
# end of Target options
#
# Toolchain options
#
#
# General toolchain options
#
CT_USE_SYSROOT=y
CT_SYSROOT_NAME="sysroot"
CT_SYSROOT_DIR_PREFIX=""
CT_WANTS_STATIC_LINK=y
CT_WANTS_STATIC_LINK_CXX=y
# CT_STATIC_TOOLCHAIN is not set
CT_SHOW_CT_VERSION=y
CT_TOOLCHAIN_PKGVERSION=""
CT_TOOLCHAIN_BUGURL=""
#
# Tuple completion and aliasing
#
CT_TARGET_VENDOR="nfdos"
CT_TARGET_ALIAS_SED_EXPR=""
CT_TARGET_ALIAS=""
#
# Toolchain type
#
CT_CROSS=y
# CT_CANADIAN is not set
CT_TOOLCHAIN_TYPE="cross"
#
# Build system
#
CT_BUILD=""
CT_BUILD_PREFIX=""
CT_BUILD_SUFFIX=""
#
# Misc options
#
# CT_TOOLCHAIN_ENABLE_NLS is not set
# CT_TOOLCHAIN_CMAKE_TOOLCHAIN_FILE is not set
# end of Toolchain options
#
# Operating System
#
CT_KERNEL_SUPPORTS_SHARED_LIBS=y
# CT_KERNEL_BARE_METAL is not set
CT_KERNEL_LINUX=y
CT_KERNEL="linux"
CT_KERNEL_CHOICE_KSYM="LINUX"
CT_KERNEL_LINUX_SHOW=y
#
# Options for linux
#
CT_KERNEL_LINUX_PKG_KSYM="LINUX"
CT_LINUX_DIR_NAME="linux"
CT_LINUX_PKG_NAME="linux"
CT_LINUX_SRC_RELEASE=y
# CT_LINUX_SRC_DEVEL is not set
CT_LINUX_PATCH_ORDER="global"
CT_LINUX_V_6_16=y
# CT_LINUX_V_6_15 is not set
# CT_LINUX_V_6_14 is not set
# CT_LINUX_V_6_13 is not set
# CT_LINUX_V_6_12 is not set
# CT_LINUX_V_6_11 is not set
# CT_LINUX_V_6_10 is not set
# CT_LINUX_V_6_9 is not set
# CT_LINUX_V_6_8 is not set
# CT_LINUX_V_6_7 is not set
# CT_LINUX_V_6_6 is not set
# CT_LINUX_V_6_5 is not set
# CT_LINUX_V_6_4 is not set
# CT_LINUX_V_6_3 is not set
# CT_LINUX_V_6_2 is not set
# CT_LINUX_V_6_1 is not set
# CT_LINUX_V_6_0 is not set
# CT_LINUX_V_5_19 is not set
# CT_LINUX_V_5_18 is not set
# CT_LINUX_V_5_17 is not set
# CT_LINUX_V_5_16 is not set
# CT_LINUX_V_5_15 is not set
# CT_LINUX_V_5_14 is not set
# CT_LINUX_V_5_13 is not set
# CT_LINUX_V_5_12 is not set
# CT_LINUX_V_5_11 is not set
# CT_LINUX_V_5_10 is not set
# CT_LINUX_V_5_9 is not set
# CT_LINUX_V_5_8 is not set
# CT_LINUX_V_5_7 is not set
# CT_LINUX_V_5_5 is not set
# CT_LINUX_V_5_4 is not set
# CT_LINUX_V_5_3 is not set
# CT_LINUX_V_5_2 is not set
# CT_LINUX_V_5_1 is not set
# CT_LINUX_V_5_0 is not set
# CT_LINUX_V_4_20 is not set
# CT_LINUX_V_4_19 is not set
# CT_LINUX_V_4_18 is not set
# CT_LINUX_V_4_17 is not set
# CT_LINUX_V_4_16 is not set
# CT_LINUX_V_4_15 is not set
# CT_LINUX_V_4_14 is not set
# CT_LINUX_V_4_13 is not set
# CT_LINUX_V_4_12 is not set
# CT_LINUX_V_4_11 is not set
# CT_LINUX_V_4_10 is not set
# CT_LINUX_V_4_9 is not set
# CT_LINUX_V_4_4 is not set
# CT_LINUX_V_4_1 is not set
# CT_LINUX_V_3_18 is not set
# CT_LINUX_V_3_16 is not set
# CT_LINUX_V_3_13 is not set
# CT_LINUX_V_3_12 is not set
# CT_LINUX_V_3_10 is not set
# CT_LINUX_V_3_4 is not set
# CT_LINUX_V_3_2 is not set
# CT_LINUX_V_2_6_32 is not set
CT_LINUX_VERSION="6.16"
CT_LINUX_MIRRORS="$(CT_Mirrors kernel.org linux ${CT_LINUX_VERSION})"
CT_LINUX_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_LINUX_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_LINUX_ARCHIVE_FORMATS=".tar.xz .tar.gz"
CT_LINUX_SIGNATURE_FORMAT="unpacked/.sign"
CT_LINUX_later_than_5_19=y
CT_LINUX_5_19_or_later=y
CT_LINUX_later_than_5_12=y
CT_LINUX_5_12_or_later=y
CT_LINUX_later_than_5_5=y
CT_LINUX_5_5_or_later=y
CT_LINUX_later_than_5_3=y
CT_LINUX_5_3_or_later=y
CT_LINUX_later_than_4_8=y
CT_LINUX_4_8_or_later=y
CT_LINUX_later_than_3_7=y
CT_LINUX_3_7_or_later=y
CT_LINUX_later_than_3_2=y
CT_LINUX_3_2_or_later=y
CT_KERNEL_has_rsync=y
CT_KERNEL_DEP_RSYNC=y
CT_KERNEL_LINUX_VERBOSITY_0=y
# CT_KERNEL_LINUX_VERBOSITY_1 is not set
# CT_KERNEL_LINUX_VERBOSITY_2 is not set
CT_KERNEL_LINUX_VERBOSE_LEVEL=0
CT_ALL_KERNEL_CHOICES="BARE_METAL LINUX WINDOWS"
#
# Common kernel options
#
CT_SHARED_LIBS=y
# end of Operating System
#
# Binary utilities
#
CT_ARCH_BINFMT_ELF=y
CT_BINUTILS_BINUTILS=y
CT_BINUTILS="binutils"
CT_BINUTILS_CHOICE_KSYM="BINUTILS"
CT_BINUTILS_BINUTILS_SHOW=y
#
# Options for binutils
#
CT_BINUTILS_BINUTILS_PKG_KSYM="BINUTILS"
CT_BINUTILS_DIR_NAME="binutils"
CT_BINUTILS_USE_GNU=y
# CT_BINUTILS_USE_ORACLE is not set
CT_BINUTILS_USE="BINUTILS"
CT_BINUTILS_PKG_NAME="binutils"
CT_BINUTILS_SRC_RELEASE=y
# CT_BINUTILS_SRC_DEVEL is not set
CT_BINUTILS_PATCH_ORDER="global"
CT_BINUTILS_V_2_45=y
# CT_BINUTILS_V_2_44 is not set
# CT_BINUTILS_V_2_43 is not set
# CT_BINUTILS_V_2_42 is not set
# CT_BINUTILS_V_2_41 is not set
# CT_BINUTILS_V_2_40 is not set
# CT_BINUTILS_V_2_39 is not set
# CT_BINUTILS_V_2_38 is not set
# CT_BINUTILS_V_2_37 is not set
# CT_BINUTILS_V_2_36 is not set
# CT_BINUTILS_V_2_35 is not set
# CT_BINUTILS_V_2_34 is not set
# CT_BINUTILS_V_2_33 is not set
# CT_BINUTILS_V_2_32 is not set
# CT_BINUTILS_V_2_31 is not set
# CT_BINUTILS_V_2_30 is not set
# CT_BINUTILS_V_2_29 is not set
# CT_BINUTILS_V_2_28 is not set
# CT_BINUTILS_V_2_27 is not set
# CT_BINUTILS_V_2_26 is not set
CT_BINUTILS_VERSION="2.45"
CT_BINUTILS_MIRRORS="$(CT_Mirrors GNU binutils) $(CT_Mirrors sourceware binutils/releases)"
CT_BINUTILS_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_BINUTILS_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_BINUTILS_ARCHIVE_FORMATS=".tar.xz .tar.bz2 .tar.gz"
CT_BINUTILS_SIGNATURE_FORMAT="packed/.sig"
CT_BINUTILS_2_45_or_later=y
CT_BINUTILS_2_45_or_older=y
CT_BINUTILS_later_than_2_44=y
CT_BINUTILS_2_44_or_later=y
CT_BINUTILS_later_than_2_41=y
CT_BINUTILS_2_41_or_later=y
CT_BINUTILS_later_than_2_39=y
CT_BINUTILS_2_39_or_later=y
CT_BINUTILS_later_than_2_30=y
CT_BINUTILS_2_30_or_later=y
CT_BINUTILS_later_than_2_27=y
CT_BINUTILS_2_27_or_later=y
CT_BINUTILS_later_than_2_26=y
CT_BINUTILS_2_26_or_later=y
#
# GNU binutils
#
CT_BINUTILS_GOLD_SUPPORTS_ARCH=y
CT_BINUTILS_LINKER_LD=y
CT_BINUTILS_LINKERS_LIST="ld"
CT_BINUTILS_LINKER_DEFAULT="bfd"
# CT_BINUTILS_PLUGINS is not set
CT_BINUTILS_RELRO=m
CT_BINUTILS_DETERMINISTIC_ARCHIVES=y
CT_BINUTILS_EXTRA_CONFIG_ARRAY=""
# CT_BINUTILS_FOR_TARGET is not set
# CT_BINUTILS_GPROFNG is not set
CT_ALL_BINUTILS_CHOICES="BINUTILS"
# end of Binary utilities
#
# C-library
#
# CT_LIBC_GLIBC is not set
CT_LIBC_MUSL=y
# CT_LIBC_UCLIBC_NG is not set
CT_LIBC="musl"
CT_LIBC_CHOICE_KSYM="MUSL"
CT_THREADS="musl"
CT_LIBC_MUSL_SHOW=y
#
# Options for musl
#
CT_LIBC_MUSL_PKG_KSYM="MUSL"
CT_MUSL_DIR_NAME="musl"
CT_MUSL_PKG_NAME="musl"
CT_MUSL_SRC_RELEASE=y
# CT_MUSL_SRC_DEVEL is not set
CT_MUSL_PATCH_ORDER="global"
CT_MUSL_V_1_2_5=y
# CT_MUSL_V_1_2_4 is not set
# CT_MUSL_V_1_2_3 is not set
# CT_MUSL_V_1_2_2 is not set
# CT_MUSL_V_1_2_1 is not set
# CT_MUSL_V_1_1_24 is not set
# CT_MUSL_V_1_1_23 is not set
# CT_MUSL_V_1_1_22 is not set
# CT_MUSL_V_1_1_21 is not set
# CT_MUSL_V_1_1_20 is not set
# CT_MUSL_V_1_1_19 is not set
# CT_MUSL_V_1_1_18 is not set
# CT_MUSL_V_1_1_17 is not set
# CT_MUSL_V_1_1_16 is not set
CT_MUSL_VERSION="1.2.5"
CT_MUSL_MIRRORS="https://www.musl-libc.org/releases"
CT_MUSL_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_MUSL_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_MUSL_ARCHIVE_FORMATS=".tar.gz"
CT_MUSL_SIGNATURE_FORMAT="packed/.asc"
# CT_LIBC_MUSL_DEBUG is not set
# CT_LIBC_MUSL_WARNINGS is not set
# CT_LIBC_MUSL_OPTIMIZE_NONE is not set
CT_LIBC_MUSL_OPTIMIZE_AUTO=y
# CT_LIBC_MUSL_OPTIMIZE_SPEED is not set
# CT_LIBC_MUSL_OPTIMIZE_SIZE is not set
CT_LIBC_MUSL_OPTIMIZE="auto"
CT_LIBC_MUSL_EXTRA_CFLAGS=""
CT_ALL_LIBC_CHOICES="AVR_LIBC GLIBC MINGW_W64 MOXIEBOX MUSL NEWLIB NONE PICOLIBC UCLIBC_NG"
CT_LIBC_SUPPORT_THREADS_ANY=y
CT_LIBC_SUPPORT_THREADS_NATIVE=y
#
# Common C library options
#
CT_THREADS_NATIVE=y
CT_CREATE_LDSO_CONF=y
CT_LDSO_CONF_EXTRA_DIRS_ARRAY=""
CT_LIBC_XLDD=y
# end of C-library
#
# C compiler
#
CT_CC_CORE_NEEDED=y
CT_CC_SUPPORT_CXX=y
CT_CC_SUPPORT_FORTRAN=y
CT_CC_SUPPORT_ADA=y
CT_CC_SUPPORT_D=y
CT_CC_SUPPORT_JIT=y
CT_CC_SUPPORT_OBJC=y
CT_CC_SUPPORT_OBJCXX=y
CT_CC_SUPPORT_GOLANG=y
CT_CC_GCC=y
CT_CC="gcc"
CT_CC_CHOICE_KSYM="GCC"
CT_CC_GCC_SHOW=y
#
# Options for gcc
#
CT_CC_GCC_PKG_KSYM="GCC"
CT_GCC_DIR_NAME="gcc"
CT_GCC_USE_GNU=y
# CT_GCC_USE_ORACLE is not set
CT_GCC_USE="GCC"
CT_GCC_PKG_NAME="gcc"
CT_GCC_SRC_RELEASE=y
# CT_GCC_SRC_DEVEL is not set
CT_GCC_PATCH_ORDER="global"
CT_GCC_V_15=y
# CT_GCC_V_14 is not set
# CT_GCC_V_13 is not set
# CT_GCC_V_12 is not set
# CT_GCC_V_11 is not set
# CT_GCC_V_10 is not set
# CT_GCC_V_9 is not set
# CT_GCC_V_8 is not set
# CT_GCC_V_7 is not set
# CT_GCC_V_6 is not set
# CT_GCC_V_5 is not set
# CT_GCC_V_4_9 is not set
CT_GCC_VERSION="15.2.0"
CT_GCC_MIRRORS="$(CT_Mirrors GNU gcc/gcc-${CT_GCC_VERSION}) $(CT_Mirrors sourceware gcc/releases/gcc-${CT_GCC_VERSION})"
CT_GCC_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_GCC_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_GCC_ARCHIVE_FORMATS=".tar.xz .tar.gz"
CT_GCC_SIGNATURE_FORMAT=""
CT_GCC_later_than_15=y
CT_GCC_15_or_later=y
CT_GCC_later_than_14=y
CT_GCC_14_or_later=y
CT_GCC_later_than_13=y
CT_GCC_13_or_later=y
CT_GCC_later_than_12=y
CT_GCC_12_or_later=y
CT_GCC_later_than_11=y
CT_GCC_11_or_later=y
CT_GCC_later_than_10=y
CT_GCC_10_or_later=y
CT_GCC_later_than_9=y
CT_GCC_9_or_later=y
CT_GCC_later_than_8=y
CT_GCC_8_or_later=y
CT_GCC_later_than_7=y
CT_GCC_7_or_later=y
CT_GCC_later_than_6=y
CT_GCC_6_or_later=y
CT_GCC_later_than_5=y
CT_GCC_5_or_later=y
CT_GCC_later_than_4_9=y
CT_GCC_4_9_or_later=y
CT_CC_GCC_HAS_LIBMPX=y
CT_CC_GCC_ENABLE_CXX_FLAGS=""
CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY=""
CT_CC_GCC_EXTRA_CONFIG_ARRAY=""
CT_CC_GCC_MULTILIB_LIST=""
CT_CC_GCC_STATIC_LIBSTDCXX=y
# CT_CC_GCC_SYSTEM_ZLIB is not set
CT_CC_GCC_CONFIG_TLS=m
#
# Optimisation features
#
CT_CC_GCC_USE_GRAPHITE=y
CT_CC_GCC_USE_LTO=y
CT_CC_GCC_LTO_ZSTD=m
#
# Settings for libraries running on target
#
# CT_CC_GCC_ENABLE_DEFAULT_PIE is not set
CT_CC_GCC_ENABLE_TARGET_OPTSPACE=y
CT_CC_GCC_LIBSTDCXX=m
# CT_CC_GCC_LIBSTDCXX_HOSTED_DISABLE is not set
CT_CC_GCC_LIBSTDCXX_TARGET_CXXFLAGS=""
# CT_CC_GCC_LIBMUDFLAP is not set
# CT_CC_GCC_LIBGOMP is not set
# CT_CC_GCC_LIBSSP is not set
# CT_CC_GCC_LIBQUADMATH is not set
CT_CC_GCC_LIBSTDCXX_VERBOSE=m
#
# Misc. obscure options.
#
CT_CC_CXA_ATEXIT=y
CT_CC_GCC_TM_CLONE_REGISTRY=m
# CT_CC_GCC_DISABLE_PCH is not set
CT_CC_GCC_SJLJ_EXCEPTIONS=m
CT_CC_GCC_LDBL_128=m
# CT_CC_GCC_BUILD_ID is not set
CT_CC_GCC_LNK_HASH_STYLE_DEFAULT=y
# CT_CC_GCC_LNK_HASH_STYLE_SYSV is not set
# CT_CC_GCC_LNK_HASH_STYLE_GNU is not set
# CT_CC_GCC_LNK_HASH_STYLE_BOTH is not set
CT_CC_GCC_LNK_HASH_STYLE=""
CT_CC_GCC_DEC_FLOATS_AUTO=y
# CT_CC_GCC_DEC_FLOATS_BID is not set
# CT_CC_GCC_DEC_FLOATS_DPD is not set
# CT_CC_GCC_DEC_FLOATS_NO is not set
CT_CC_GCC_DEC_FLOATS=""
CT_ALL_CC_CHOICES="GCC"
#
# Additional supported languages:
#
CT_CC_LANG_CXX=y
# CT_CC_LANG_FORTRAN is not set
# end of C compiler
#
# Linkers
#
#
# BFD enabled in binutils
#
# CT_LINKER_MOLD is not set
CT_ALL_LINKER_CHOICES="MOLD"
# end of Linkers
#
# Debug facilities
#
# CT_DEBUG_DUMA is not set
# CT_DEBUG_GDB is not set
# CT_DEBUG_LTRACE is not set
# CT_DEBUG_STRACE is not set
CT_ALL_DEBUG_CHOICES="DUMA GDB LTRACE STRACE"
# end of Debug facilities
#
# Companion libraries
#
# CT_COMPLIBS_CHECK is not set
# CT_COMP_LIBS_CLOOG is not set
# CT_COMP_LIBS_EXPAT is not set
CT_COMP_LIBS_GETTEXT=y
CT_COMP_LIBS_GETTEXT_PKG_KSYM="GETTEXT"
CT_GETTEXT_DIR_NAME="gettext"
CT_GETTEXT_PKG_NAME="gettext"
CT_GETTEXT_SRC_RELEASE=y
# CT_GETTEXT_SRC_DEVEL is not set
CT_GETTEXT_PATCH_ORDER="global"
CT_GETTEXT_V_0_26=y
# CT_GETTEXT_V_0_23_1 is not set
# CT_GETTEXT_V_0_22_5 is not set
# CT_GETTEXT_V_0_21 is not set
# CT_GETTEXT_V_0_20_1 is not set
# CT_GETTEXT_V_0_19_8_1 is not set
CT_GETTEXT_VERSION="0.26"
CT_GETTEXT_MIRRORS="$(CT_Mirrors GNU gettext)"
CT_GETTEXT_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_GETTEXT_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_GETTEXT_ARCHIVE_FORMATS=".tar.xz .tar.gz"
CT_GETTEXT_SIGNATURE_FORMAT="packed/.sig"
CT_GETTEXT_later_than_0_23=y
CT_GETTEXT_0_23_or_later=y
CT_GETTEXT_later_than_0_21=y
CT_GETTEXT_0_21_or_later=y
CT_GETTEXT_INCOMPATIBLE_WITH_UCLIBC_NG=y
#
# This version of gettext is not compatible with uClibc-NG. Select
#
#
# a different version if uClibc-NG is used on the target or (in a
#
#
# Canadian cross build) on the host.
#
CT_COMP_LIBS_GMP=y
CT_COMP_LIBS_GMP_PKG_KSYM="GMP"
CT_GMP_DIR_NAME="gmp"
CT_GMP_PKG_NAME="gmp"
CT_GMP_SRC_RELEASE=y
# CT_GMP_SRC_DEVEL is not set
CT_GMP_PATCH_ORDER="global"
CT_GMP_V_6_3=y
# CT_GMP_V_6_2 is not set
# CT_GMP_V_6_1 is not set
CT_GMP_VERSION="6.3.0"
CT_GMP_MIRRORS="https://gmplib.org/download/gmp https://gmplib.org/download/gmp/archive $(CT_Mirrors GNU gmp)"
CT_GMP_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_GMP_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_GMP_ARCHIVE_FORMATS=".tar.xz .tar.lz .tar.bz2"
CT_GMP_SIGNATURE_FORMAT="packed/.sig"
CT_GMP_EXTRA_CFLAGS="-std=gnu17"
CT_COMP_LIBS_ISL=y
CT_COMP_LIBS_ISL_PKG_KSYM="ISL"
CT_ISL_DIR_NAME="isl"
CT_ISL_PKG_NAME="isl"
CT_ISL_SRC_RELEASE=y
# CT_ISL_SRC_DEVEL is not set
CT_ISL_PATCH_ORDER="global"
CT_ISL_V_0_27=y
# CT_ISL_V_0_26 is not set
# CT_ISL_V_0_25 is not set
# CT_ISL_V_0_24 is not set
# CT_ISL_V_0_23 is not set
# CT_ISL_V_0_22 is not set
# CT_ISL_V_0_21 is not set
# CT_ISL_V_0_20 is not set
# CT_ISL_V_0_19 is not set
# CT_ISL_V_0_18 is not set
# CT_ISL_V_0_17 is not set
# CT_ISL_V_0_16 is not set
# CT_ISL_V_0_15 is not set
# CT_ISL_V_0_11 is not set
CT_ISL_VERSION="0.27"
CT_ISL_MIRRORS="https://libisl.sourceforge.io"
CT_ISL_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ISL_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ISL_ARCHIVE_FORMATS=".tar.xz .tar.bz2 .tar.gz"
CT_ISL_SIGNATURE_FORMAT=""
CT_ISL_later_than_0_18=y
CT_ISL_0_18_or_later=y
CT_ISL_later_than_0_15=y
CT_ISL_0_15_or_later=y
# CT_COMP_LIBS_LIBELF is not set
CT_COMP_LIBS_LIBICONV=y
CT_COMP_LIBS_LIBICONV_PKG_KSYM="LIBICONV"
CT_LIBICONV_DIR_NAME="libiconv"
CT_LIBICONV_PKG_NAME="libiconv"
CT_LIBICONV_SRC_RELEASE=y
# CT_LIBICONV_SRC_DEVEL is not set
CT_LIBICONV_PATCH_ORDER="global"
CT_LIBICONV_V_1_18=y
# CT_LIBICONV_V_1_16 is not set
# CT_LIBICONV_V_1_15 is not set
CT_LIBICONV_VERSION="1.18"
CT_LIBICONV_MIRRORS="$(CT_Mirrors GNU libiconv)"
CT_LIBICONV_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_LIBICONV_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_LIBICONV_ARCHIVE_FORMATS=".tar.gz"
CT_LIBICONV_SIGNATURE_FORMAT="packed/.sig"
CT_COMP_LIBS_MPC=y
CT_COMP_LIBS_MPC_PKG_KSYM="MPC"
CT_MPC_DIR_NAME="mpc"
CT_MPC_PKG_NAME="mpc"
CT_MPC_SRC_RELEASE=y
# CT_MPC_SRC_DEVEL is not set
CT_MPC_PATCH_ORDER="global"
CT_MPC_V_1_3=y
CT_MPC_VERSION="1.3.1"
CT_MPC_MIRRORS="https://www.multiprecision.org/downloads $(CT_Mirrors GNU mpc)"
CT_MPC_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_MPC_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_MPC_ARCHIVE_FORMATS=".tar.gz"
CT_MPC_SIGNATURE_FORMAT="packed/.sig"
CT_COMP_LIBS_MPFR=y
CT_COMP_LIBS_MPFR_PKG_KSYM="MPFR"
CT_MPFR_DIR_NAME="mpfr"
CT_MPFR_PKG_NAME="mpfr"
CT_MPFR_SRC_RELEASE=y
# CT_MPFR_SRC_DEVEL is not set
CT_MPFR_PATCH_ORDER="global"
CT_MPFR_V_4_2=y
CT_MPFR_VERSION="4.2.2"
CT_MPFR_MIRRORS="https://www.mpfr.org/mpfr-${CT_MPFR_VERSION} $(CT_Mirrors GNU mpfr)"
CT_MPFR_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_MPFR_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_MPFR_ARCHIVE_FORMATS=".tar.xz .tar.bz2 .tar.gz .zip"
CT_MPFR_SIGNATURE_FORMAT="packed/.asc"
CT_COMP_LIBS_NCURSES=y
CT_COMP_LIBS_NCURSES_PKG_KSYM="NCURSES"
CT_NCURSES_DIR_NAME="ncurses"
CT_NCURSES_PKG_NAME="ncurses"
CT_NCURSES_SRC_RELEASE=y
# CT_NCURSES_SRC_DEVEL is not set
CT_NCURSES_PATCH_ORDER="global"
CT_NCURSES_V_6_5=y
# CT_NCURSES_V_6_4 is not set
# CT_NCURSES_V_6_2 is not set
# CT_NCURSES_V_6_1 is not set
# CT_NCURSES_V_6_0 is not set
CT_NCURSES_VERSION="6.5"
CT_NCURSES_MIRRORS="https://invisible-mirror.net/archives/ncurses $(CT_Mirrors GNU ncurses)"
CT_NCURSES_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_NCURSES_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_NCURSES_ARCHIVE_FORMATS=".tar.gz"
CT_NCURSES_SIGNATURE_FORMAT="packed/.asc"
CT_NCURSES_NEW_ABI=y
CT_NCURSES_HOST_CONFIG_ARGS=""
CT_NCURSES_HOST_DISABLE_DB=y
CT_NCURSES_HOST_FALLBACKS="linux,xterm,xterm-color,xterm-256color,vt100"
CT_NCURSES_TARGET_CONFIG_ARGS=""
# CT_NCURSES_TARGET_DISABLE_DB is not set
CT_NCURSES_TARGET_FALLBACKS=""
CT_NCURSES_EXTRA_CFLAGS="-std=gnu17"
CT_COMP_LIBS_ZLIB=y
CT_COMP_LIBS_ZLIB_PKG_KSYM="ZLIB"
CT_ZLIB_DIR_NAME="zlib"
CT_ZLIB_PKG_NAME="zlib"
CT_ZLIB_SRC_RELEASE=y
# CT_ZLIB_SRC_DEVEL is not set
CT_ZLIB_PATCH_ORDER="global"
CT_ZLIB_V_1_3_1=y
# CT_ZLIB_V_1_2_13 is not set
CT_ZLIB_VERSION="1.3.1"
CT_ZLIB_MIRRORS="https://github.com/madler/zlib/releases/download/v${CT_ZLIB_VERSION} https://www.zlib.net/"
CT_ZLIB_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_FORMATS=".tar.xz .tar.gz"
CT_ZLIB_SIGNATURE_FORMAT="packed/.asc"
CT_COMP_LIBS_ZSTD=y
CT_COMP_LIBS_ZSTD_PKG_KSYM="ZSTD"
CT_ZSTD_DIR_NAME="zstd"
CT_ZSTD_PKG_NAME="zstd"
CT_ZSTD_SRC_RELEASE=y
# CT_ZSTD_SRC_DEVEL is not set
CT_ZSTD_PATCH_ORDER="global"
CT_ZSTD_V_1_5_7=y
# CT_ZSTD_V_1_5_6 is not set
# CT_ZSTD_V_1_5_5 is not set
# CT_ZSTD_V_1_5_2 is not set
CT_ZSTD_VERSION="1.5.7"
CT_ZSTD_MIRRORS="https://github.com/facebook/zstd/releases/download/v${CT_ZSTD_VERSION} https://downloads.sourceforge.net/project/zstandard.mirror/v${CT_ZSTD_VERSION}"
CT_ZSTD_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZSTD_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ZSTD_ARCHIVE_FORMATS=".tar.gz"
CT_ZSTD_SIGNATURE_FORMAT="packed/.sig"
CT_ALL_COMP_LIBS_CHOICES="CLOOG EXPAT GETTEXT GMP GNUPRUMCU ISL LIBELF LIBICONV MPC MPFR NCURSES NEWLIB_NANO PICOLIBC ZLIB ZSTD"
CT_LIBICONV_NEEDED=y
CT_GETTEXT_NEEDED=y
CT_GMP_NEEDED=y
CT_MPFR_NEEDED=y
CT_ISL_NEEDED=y
CT_MPC_NEEDED=y
CT_NCURSES_NEEDED=y
CT_ZLIB_NEEDED=y
CT_ZSTD_NEEDED=y
CT_LIBICONV=y
CT_GETTEXT=y
CT_GMP=y
CT_MPFR=y
CT_ISL=y
CT_MPC=y
CT_NCURSES=y
CT_ZLIB=y
CT_ZSTD=y
# end of Companion libraries
#
# Companion tools
#
# CT_COMP_TOOLS_FOR_HOST is not set
# CT_COMP_TOOLS_AUTOCONF is not set
# CT_COMP_TOOLS_AUTOMAKE is not set
# CT_COMP_TOOLS_BISON is not set
# CT_COMP_TOOLS_DTC is not set
# CT_COMP_TOOLS_LIBTOOL is not set
# CT_COMP_TOOLS_M4 is not set
# CT_COMP_TOOLS_MAKE is not set
CT_ALL_COMP_TOOLS_CHOICES="AUTOCONF AUTOMAKE BISON DTC LIBTOOL M4 MAKE"
# end of Companion tools

View File

@ -0,0 +1,857 @@
#
# Automatically generated file; DO NOT EDIT.
# crosstool-NG 1.28.0.1_403899e Configuration
#
CT_CONFIGURE_has_static_link=y
CT_CONFIGURE_has_cxx11=y
CT_CONFIGURE_has_wget=y
CT_CONFIGURE_has_curl=y
CT_CONFIGURE_has_meson=y
CT_CONFIGURE_has_ninja=y
CT_CONFIGURE_has_make_3_81_or_newer=y
CT_CONFIGURE_has_make_4_0_or_newer=y
CT_CONFIGURE_has_libtool_2_4_or_newer=y
CT_CONFIGURE_has_libtoolize_2_4_or_newer=y
CT_CONFIGURE_has_autoconf_2_65_or_newer=y
CT_CONFIGURE_has_autoreconf_2_65_or_newer=y
CT_CONFIGURE_has_automake_1_15_or_newer=y
CT_CONFIGURE_has_gnu_m4_1_4_12_or_newer=y
CT_CONFIGURE_has_python_3_4_or_newer=y
CT_CONFIGURE_has_bison_2_7_or_newer=y
CT_CONFIGURE_has_bison_3_0_4_or_newer=y
CT_CONFIGURE_has_python=y
CT_CONFIGURE_has_git=y
CT_CONFIGURE_has_md5sum=y
CT_CONFIGURE_has_sha1sum=y
CT_CONFIGURE_has_sha256sum=y
CT_CONFIGURE_has_sha512sum=y
CT_CONFIGURE_has_install_with_strip_program=y
CT_VERSION="1.28.0.1_403899e"
CT_VCHECK=""
CT_CONFIG_VERSION_ENV="4"
CT_CONFIG_VERSION_CURRENT="4"
CT_CONFIG_VERSION="4"
CT_MODULES=y
#
# Paths and misc options
#
#
# crosstool-NG behavior
#
CT_OBSOLETE=y
# CT_EXPERIMENTAL is not set
# CT_DEBUG_CT is not set
#
# Paths
#
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
# CT_TARBALLS_BUILDROOT_LAYOUT is not set
CT_WORK_DIR="${CT_TOP_DIR}/.build"
CT_BUILD_TOP_DIR="${CT_WORK_DIR:-${CT_TOP_DIR}/.build}/${CT_HOST:+HOST-${CT_HOST}/}${CT_TARGET}"
CT_BUILD_DIR="${CT_BUILD_TOP_DIR}/build"
CT_PREFIX_DIR="${CT_PREFIX:-${HOME}/x-tools}/${CT_HOST:+HOST-${CT_HOST}/}${CT_TARGET}"
CT_RM_RF_PREFIX_DIR=y
CT_REMOVE_DOCS=y
CT_INSTALL_LICENSES=y
CT_PREFIX_DIR_RO=y
CT_STRIP_HOST_TOOLCHAIN_EXECUTABLES=y
# CT_STRIP_TARGET_TOOLCHAIN_EXECUTABLES is not set
#
# Downloading
#
CT_DOWNLOAD_AGENT_WGET=y
# CT_DOWNLOAD_AGENT_CURL is not set
# CT_DOWNLOAD_AGENT_NONE is not set
# CT_FORBID_DOWNLOAD is not set
# CT_FORCE_DOWNLOAD is not set
CT_CONNECT_TIMEOUT=10
CT_DOWNLOAD_WGET_OPTIONS="--tries=3 -nc --progress=dot:binary"
# CT_ONLY_DOWNLOAD is not set
# CT_USE_MIRROR is not set
CT_VERIFY_DOWNLOAD_DIGEST=y
CT_VERIFY_DOWNLOAD_DIGEST_SHA512=y
# CT_VERIFY_DOWNLOAD_DIGEST_SHA256 is not set
# CT_VERIFY_DOWNLOAD_DIGEST_SHA1 is not set
# CT_VERIFY_DOWNLOAD_DIGEST_MD5 is not set
CT_VERIFY_DOWNLOAD_DIGEST_ALG="sha512"
# CT_VERIFY_DOWNLOAD_SIGNATURE is not set
#
# Extracting
#
# CT_FORCE_EXTRACT is not set
CT_OVERRIDE_CONFIG_GUESS_SUB=y
# CT_ONLY_EXTRACT is not set
CT_PATCH_BUNDLED=y
# CT_PATCH_BUNDLED_LOCAL is not set
CT_PATCH_ORDER="bundled"
#
# Build behavior
#
CT_PARALLEL_JOBS=0
CT_LOAD=""
CT_USE_PIPES=y
CT_EXTRA_CFLAGS_FOR_BUILD=""
CT_EXTRA_CXXFLAGS_FOR_BUILD=""
CT_EXTRA_LDFLAGS_FOR_BUILD=""
CT_EXTRA_CFLAGS_FOR_HOST=""
CT_EXTRA_LDFLAGS_FOR_HOST=""
# CT_CONFIG_SHELL_SH is not set
# CT_CONFIG_SHELL_ASH is not set
CT_CONFIG_SHELL_BASH=y
# CT_CONFIG_SHELL_CUSTOM is not set
CT_CONFIG_SHELL="${bash}"
#
# Logging
#
# CT_LOG_ERROR is not set
# CT_LOG_WARN is not set
# CT_LOG_INFO is not set
CT_LOG_EXTRA=y
# CT_LOG_ALL is not set
# CT_LOG_DEBUG is not set
CT_LOG_LEVEL_MAX="EXTRA"
# CT_LOG_SEE_TOOLS_WARN is not set
CT_LOG_PROGRESS_BAR=y
CT_LOG_TO_FILE=y
CT_LOG_FILE_COMPRESS=y
# end of Paths and misc options
#
# Target options
#
# CT_ARCH_ALPHA is not set
# CT_ARCH_ARC is not set
# CT_ARCH_ARM is not set
# CT_ARCH_AVR is not set
# CT_ARCH_BPF is not set
# CT_ARCH_M68K is not set
# CT_ARCH_MIPS is not set
# CT_ARCH_NIOS2 is not set
# CT_ARCH_POWERPC is not set
# CT_ARCH_PRU is not set
# CT_ARCH_RISCV is not set
# CT_ARCH_RX is not set
# CT_ARCH_S390 is not set
# CT_ARCH_SH is not set
# CT_ARCH_SPARC is not set
CT_ARCH_X86=y
# CT_ARCH_XTENSA is not set
CT_ARCH="x86"
CT_ARCH_CHOICE_KSYM="X86"
CT_ARCH_CPU=""
CT_ARCH_TUNE=""
CT_ARCH_X86_SHOW=y
#
# Options for x86
#
CT_ARCH_X86_PKG_KSYM=""
CT_ALL_ARCH_CHOICES="ALPHA ARC ARM AVR BPF C6X LM32 LOONGARCH M68K MICROBLAZE MIPS MOXIE MSP430 NIOS2 OPENRISC PARISC POWERPC PRU RISCV RX S390 SH SPARC TRICORE X86 XTENSA"
CT_ARCH_SUFFIX=""
# CT_OMIT_TARGET_VENDOR is not set
#
# Generic target options
#
CT_MULTILIB=y
CT_ARCH_USE_MMU=y
CT_ARCH_SUPPORTS_LIBSANITIZER=y
CT_ARCH_SUPPORTS_32=y
CT_ARCH_SUPPORTS_64=y
CT_ARCH_DEFAULT_32=y
CT_ARCH_BITNESS=64
# CT_ARCH_32 is not set
CT_ARCH_64=y
CT_ARCH_SUPPORTS_WITH_32_64=y
#
# Target optimisations
#
CT_ARCH_SUPPORTS_WITH_ARCH=y
CT_ARCH_SUPPORTS_WITH_CPU=y
CT_ARCH_SUPPORTS_WITH_TUNE=y
CT_ARCH_ARCH=""
CT_TARGET_CFLAGS=""
CT_TARGET_LDFLAGS=""
# end of Target options
#
# Toolchain options
#
#
# General toolchain options
#
CT_USE_SYSROOT=y
CT_SYSROOT_NAME="sysroot"
CT_SYSROOT_DIR_PREFIX=""
CT_WANTS_STATIC_LINK=y
CT_WANTS_STATIC_LINK_CXX=y
# CT_STATIC_TOOLCHAIN is not set
CT_SHOW_CT_VERSION=y
CT_TOOLCHAIN_PKGVERSION=""
CT_TOOLCHAIN_BUGURL=""
#
# Tuple completion and aliasing
#
CT_TARGET_VENDOR="nfdos"
CT_TARGET_ALIAS_SED_EXPR=""
CT_TARGET_ALIAS=""
#
# Toolchain type
#
CT_CROSS=y
# CT_CANADIAN is not set
CT_TOOLCHAIN_TYPE="cross"
#
# Build system
#
CT_BUILD=""
CT_BUILD_PREFIX=""
CT_BUILD_SUFFIX=""
#
# Misc options
#
# CT_TOOLCHAIN_ENABLE_NLS is not set
# CT_TOOLCHAIN_CMAKE_TOOLCHAIN_FILE is not set
# end of Toolchain options
#
# Operating System
#
CT_KERNEL_SUPPORTS_SHARED_LIBS=y
# CT_KERNEL_BARE_METAL is not set
CT_KERNEL_LINUX=y
CT_KERNEL="linux"
CT_KERNEL_CHOICE_KSYM="LINUX"
CT_KERNEL_LINUX_SHOW=y
#
# Options for linux
#
CT_KERNEL_LINUX_PKG_KSYM="LINUX"
CT_LINUX_DIR_NAME="linux"
CT_LINUX_PKG_NAME="linux"
CT_LINUX_SRC_RELEASE=y
# CT_LINUX_SRC_DEVEL is not set
CT_LINUX_PATCH_ORDER="global"
CT_LINUX_V_6_16=y
# CT_LINUX_V_6_15 is not set
# CT_LINUX_V_6_14 is not set
# CT_LINUX_V_6_13 is not set
# CT_LINUX_V_6_12 is not set
# CT_LINUX_V_6_11 is not set
# CT_LINUX_V_6_10 is not set
# CT_LINUX_V_6_9 is not set
# CT_LINUX_V_6_8 is not set
# CT_LINUX_V_6_7 is not set
# CT_LINUX_V_6_6 is not set
# CT_LINUX_V_6_5 is not set
# CT_LINUX_V_6_4 is not set
# CT_LINUX_V_6_3 is not set
# CT_LINUX_V_6_2 is not set
# CT_LINUX_V_6_1 is not set
# CT_LINUX_V_6_0 is not set
# CT_LINUX_V_5_19 is not set
# CT_LINUX_V_5_18 is not set
# CT_LINUX_V_5_17 is not set
# CT_LINUX_V_5_16 is not set
# CT_LINUX_V_5_15 is not set
# CT_LINUX_V_5_14 is not set
# CT_LINUX_V_5_13 is not set
# CT_LINUX_V_5_12 is not set
# CT_LINUX_V_5_11 is not set
# CT_LINUX_V_5_10 is not set
# CT_LINUX_V_5_9 is not set
# CT_LINUX_V_5_8 is not set
# CT_LINUX_V_5_7 is not set
# CT_LINUX_V_5_5 is not set
# CT_LINUX_V_5_4 is not set
# CT_LINUX_V_5_3 is not set
# CT_LINUX_V_5_2 is not set
# CT_LINUX_V_5_1 is not set
# CT_LINUX_V_5_0 is not set
# CT_LINUX_V_4_20 is not set
# CT_LINUX_V_4_19 is not set
# CT_LINUX_V_4_18 is not set
# CT_LINUX_V_4_17 is not set
# CT_LINUX_V_4_16 is not set
# CT_LINUX_V_4_15 is not set
# CT_LINUX_V_4_14 is not set
# CT_LINUX_V_4_13 is not set
# CT_LINUX_V_4_12 is not set
# CT_LINUX_V_4_11 is not set
# CT_LINUX_V_4_10 is not set
# CT_LINUX_V_4_9 is not set
# CT_LINUX_V_4_4 is not set
# CT_LINUX_V_4_1 is not set
# CT_LINUX_V_3_18 is not set
# CT_LINUX_V_3_16 is not set
# CT_LINUX_V_3_13 is not set
# CT_LINUX_V_3_12 is not set
# CT_LINUX_V_3_10 is not set
# CT_LINUX_V_3_4 is not set
# CT_LINUX_V_3_2 is not set
# CT_LINUX_V_2_6_32 is not set
CT_LINUX_VERSION="6.16"
CT_LINUX_MIRRORS="$(CT_Mirrors kernel.org linux ${CT_LINUX_VERSION})"
CT_LINUX_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_LINUX_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_LINUX_ARCHIVE_FORMATS=".tar.xz .tar.gz"
CT_LINUX_SIGNATURE_FORMAT="unpacked/.sign"
CT_LINUX_later_than_5_19=y
CT_LINUX_5_19_or_later=y
CT_LINUX_later_than_5_12=y
CT_LINUX_5_12_or_later=y
CT_LINUX_later_than_5_5=y
CT_LINUX_5_5_or_later=y
CT_LINUX_later_than_5_3=y
CT_LINUX_5_3_or_later=y
CT_LINUX_later_than_4_8=y
CT_LINUX_4_8_or_later=y
CT_LINUX_later_than_3_7=y
CT_LINUX_3_7_or_later=y
CT_LINUX_later_than_3_2=y
CT_LINUX_3_2_or_later=y
CT_KERNEL_has_rsync=y
CT_KERNEL_DEP_RSYNC=y
CT_KERNEL_LINUX_VERBOSITY_0=y
# CT_KERNEL_LINUX_VERBOSITY_1 is not set
# CT_KERNEL_LINUX_VERBOSITY_2 is not set
CT_KERNEL_LINUX_VERBOSE_LEVEL=0
CT_ALL_KERNEL_CHOICES="BARE_METAL LINUX WINDOWS"
#
# Common kernel options
#
CT_SHARED_LIBS=y
# end of Operating System
#
# Binary utilities
#
CT_ARCH_BINFMT_ELF=y
CT_BINUTILS_BINUTILS=y
CT_BINUTILS="binutils"
CT_BINUTILS_CHOICE_KSYM="BINUTILS"
CT_BINUTILS_BINUTILS_SHOW=y
#
# Options for binutils
#
CT_BINUTILS_BINUTILS_PKG_KSYM="BINUTILS"
CT_BINUTILS_DIR_NAME="binutils"
CT_BINUTILS_USE_GNU=y
# CT_BINUTILS_USE_ORACLE is not set
CT_BINUTILS_USE="BINUTILS"
CT_BINUTILS_PKG_NAME="binutils"
CT_BINUTILS_SRC_RELEASE=y
# CT_BINUTILS_SRC_DEVEL is not set
CT_BINUTILS_PATCH_ORDER="global"
CT_BINUTILS_V_2_45=y
# CT_BINUTILS_V_2_44 is not set
# CT_BINUTILS_V_2_43 is not set
# CT_BINUTILS_V_2_42 is not set
# CT_BINUTILS_V_2_41 is not set
# CT_BINUTILS_V_2_40 is not set
# CT_BINUTILS_V_2_39 is not set
# CT_BINUTILS_V_2_38 is not set
# CT_BINUTILS_V_2_37 is not set
# CT_BINUTILS_V_2_36 is not set
# CT_BINUTILS_V_2_35 is not set
# CT_BINUTILS_V_2_34 is not set
# CT_BINUTILS_V_2_33 is not set
# CT_BINUTILS_V_2_32 is not set
# CT_BINUTILS_V_2_31 is not set
# CT_BINUTILS_V_2_30 is not set
# CT_BINUTILS_V_2_29 is not set
# CT_BINUTILS_V_2_28 is not set
# CT_BINUTILS_V_2_27 is not set
# CT_BINUTILS_V_2_26 is not set
CT_BINUTILS_VERSION="2.45"
CT_BINUTILS_MIRRORS="$(CT_Mirrors GNU binutils) $(CT_Mirrors sourceware binutils/releases)"
CT_BINUTILS_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_BINUTILS_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_BINUTILS_ARCHIVE_FORMATS=".tar.xz .tar.bz2 .tar.gz"
CT_BINUTILS_SIGNATURE_FORMAT="packed/.sig"
CT_BINUTILS_2_45_or_later=y
CT_BINUTILS_2_45_or_older=y
CT_BINUTILS_later_than_2_44=y
CT_BINUTILS_2_44_or_later=y
CT_BINUTILS_later_than_2_41=y
CT_BINUTILS_2_41_or_later=y
CT_BINUTILS_later_than_2_39=y
CT_BINUTILS_2_39_or_later=y
CT_BINUTILS_later_than_2_30=y
CT_BINUTILS_2_30_or_later=y
CT_BINUTILS_later_than_2_27=y
CT_BINUTILS_2_27_or_later=y
CT_BINUTILS_later_than_2_26=y
CT_BINUTILS_2_26_or_later=y
#
# GNU binutils
#
CT_BINUTILS_GOLD_SUPPORTS_ARCH=y
CT_BINUTILS_LINKER_LD=y
CT_BINUTILS_LINKERS_LIST="ld"
CT_BINUTILS_LINKER_DEFAULT="bfd"
# CT_BINUTILS_PLUGINS is not set
CT_BINUTILS_RELRO=m
CT_BINUTILS_DETERMINISTIC_ARCHIVES=y
CT_BINUTILS_EXTRA_CONFIG_ARRAY=""
# CT_BINUTILS_FOR_TARGET is not set
# CT_BINUTILS_GPROFNG is not set
CT_ALL_BINUTILS_CHOICES="BINUTILS"
# end of Binary utilities
#
# C-library
#
# CT_LIBC_GLIBC is not set
CT_LIBC_MUSL=y
# CT_LIBC_UCLIBC_NG is not set
CT_LIBC="musl"
CT_LIBC_CHOICE_KSYM="MUSL"
CT_THREADS="musl"
CT_LIBC_MUSL_SHOW=y
#
# Options for musl
#
CT_LIBC_MUSL_PKG_KSYM="MUSL"
CT_MUSL_DIR_NAME="musl"
CT_MUSL_PKG_NAME="musl"
CT_MUSL_SRC_RELEASE=y
# CT_MUSL_SRC_DEVEL is not set
CT_MUSL_PATCH_ORDER="global"
CT_MUSL_V_1_2_5=y
# CT_MUSL_V_1_2_4 is not set
# CT_MUSL_V_1_2_3 is not set
# CT_MUSL_V_1_2_2 is not set
# CT_MUSL_V_1_2_1 is not set
# CT_MUSL_V_1_1_24 is not set
# CT_MUSL_V_1_1_23 is not set
# CT_MUSL_V_1_1_22 is not set
# CT_MUSL_V_1_1_21 is not set
# CT_MUSL_V_1_1_20 is not set
# CT_MUSL_V_1_1_19 is not set
# CT_MUSL_V_1_1_18 is not set
# CT_MUSL_V_1_1_17 is not set
# CT_MUSL_V_1_1_16 is not set
CT_MUSL_VERSION="1.2.5"
CT_MUSL_MIRRORS="https://www.musl-libc.org/releases"
CT_MUSL_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_MUSL_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_MUSL_ARCHIVE_FORMATS=".tar.gz"
CT_MUSL_SIGNATURE_FORMAT="packed/.asc"
# CT_LIBC_MUSL_DEBUG is not set
# CT_LIBC_MUSL_WARNINGS is not set
# CT_LIBC_MUSL_OPTIMIZE_NONE is not set
CT_LIBC_MUSL_OPTIMIZE_AUTO=y
# CT_LIBC_MUSL_OPTIMIZE_SPEED is not set
# CT_LIBC_MUSL_OPTIMIZE_SIZE is not set
CT_LIBC_MUSL_OPTIMIZE="auto"
CT_LIBC_MUSL_EXTRA_CFLAGS=""
CT_ALL_LIBC_CHOICES="AVR_LIBC GLIBC MINGW_W64 MOXIEBOX MUSL NEWLIB NONE PICOLIBC UCLIBC_NG"
CT_LIBC_SUPPORT_THREADS_ANY=y
CT_LIBC_SUPPORT_THREADS_NATIVE=y
#
# Common C library options
#
CT_THREADS_NATIVE=y
CT_CREATE_LDSO_CONF=y
CT_LDSO_CONF_EXTRA_DIRS_ARRAY=""
CT_LIBC_XLDD=y
# end of C-library
#
# C compiler
#
CT_CC_CORE_NEEDED=y
CT_CC_SUPPORT_CXX=y
CT_CC_SUPPORT_FORTRAN=y
CT_CC_SUPPORT_ADA=y
CT_CC_SUPPORT_D=y
CT_CC_SUPPORT_JIT=y
CT_CC_SUPPORT_OBJC=y
CT_CC_SUPPORT_OBJCXX=y
CT_CC_SUPPORT_GOLANG=y
CT_CC_GCC=y
CT_CC="gcc"
CT_CC_CHOICE_KSYM="GCC"
CT_CC_GCC_SHOW=y
#
# Options for gcc
#
CT_CC_GCC_PKG_KSYM="GCC"
CT_GCC_DIR_NAME="gcc"
CT_GCC_USE_GNU=y
# CT_GCC_USE_ORACLE is not set
CT_GCC_USE="GCC"
CT_GCC_PKG_NAME="gcc"
CT_GCC_SRC_RELEASE=y
# CT_GCC_SRC_DEVEL is not set
CT_GCC_PATCH_ORDER="global"
CT_GCC_V_15=y
# CT_GCC_V_14 is not set
# CT_GCC_V_13 is not set
# CT_GCC_V_12 is not set
# CT_GCC_V_11 is not set
# CT_GCC_V_10 is not set
# CT_GCC_V_9 is not set
# CT_GCC_V_8 is not set
# CT_GCC_V_7 is not set
# CT_GCC_V_6 is not set
# CT_GCC_V_5 is not set
# CT_GCC_V_4_9 is not set
CT_GCC_VERSION="15.2.0"
CT_GCC_MIRRORS="$(CT_Mirrors GNU gcc/gcc-${CT_GCC_VERSION}) $(CT_Mirrors sourceware gcc/releases/gcc-${CT_GCC_VERSION})"
CT_GCC_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_GCC_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_GCC_ARCHIVE_FORMATS=".tar.xz .tar.gz"
CT_GCC_SIGNATURE_FORMAT=""
CT_GCC_later_than_15=y
CT_GCC_15_or_later=y
CT_GCC_later_than_14=y
CT_GCC_14_or_later=y
CT_GCC_later_than_13=y
CT_GCC_13_or_later=y
CT_GCC_later_than_12=y
CT_GCC_12_or_later=y
CT_GCC_later_than_11=y
CT_GCC_11_or_later=y
CT_GCC_later_than_10=y
CT_GCC_10_or_later=y
CT_GCC_later_than_9=y
CT_GCC_9_or_later=y
CT_GCC_later_than_8=y
CT_GCC_8_or_later=y
CT_GCC_later_than_7=y
CT_GCC_7_or_later=y
CT_GCC_later_than_6=y
CT_GCC_6_or_later=y
CT_GCC_later_than_5=y
CT_GCC_5_or_later=y
CT_GCC_later_than_4_9=y
CT_GCC_4_9_or_later=y
CT_CC_GCC_HAS_LIBMPX=y
CT_CC_GCC_ENABLE_CXX_FLAGS=""
CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY=""
CT_CC_GCC_EXTRA_CONFIG_ARRAY=""
CT_CC_GCC_MULTILIB_LIST=""
CT_CC_GCC_STATIC_LIBSTDCXX=y
# CT_CC_GCC_SYSTEM_ZLIB is not set
CT_CC_GCC_CONFIG_TLS=m
#
# Optimisation features
#
CT_CC_GCC_USE_GRAPHITE=y
CT_CC_GCC_USE_LTO=y
CT_CC_GCC_LTO_ZSTD=m
#
# Settings for libraries running on target
#
# CT_CC_GCC_ENABLE_DEFAULT_PIE is not set
CT_CC_GCC_ENABLE_TARGET_OPTSPACE=y
CT_CC_GCC_LIBSTDCXX=m
# CT_CC_GCC_LIBSTDCXX_HOSTED_DISABLE is not set
CT_CC_GCC_LIBSTDCXX_TARGET_CXXFLAGS=""
# CT_CC_GCC_LIBMUDFLAP is not set
# CT_CC_GCC_LIBGOMP is not set
# CT_CC_GCC_LIBSSP is not set
# CT_CC_GCC_LIBQUADMATH is not set
CT_CC_GCC_LIBSTDCXX_VERBOSE=m
#
# Misc. obscure options.
#
CT_CC_CXA_ATEXIT=y
CT_CC_GCC_TM_CLONE_REGISTRY=m
# CT_CC_GCC_DISABLE_PCH is not set
CT_CC_GCC_SJLJ_EXCEPTIONS=m
CT_CC_GCC_LDBL_128=m
# CT_CC_GCC_BUILD_ID is not set
CT_CC_GCC_LNK_HASH_STYLE_DEFAULT=y
# CT_CC_GCC_LNK_HASH_STYLE_SYSV is not set
# CT_CC_GCC_LNK_HASH_STYLE_GNU is not set
# CT_CC_GCC_LNK_HASH_STYLE_BOTH is not set
CT_CC_GCC_LNK_HASH_STYLE=""
CT_CC_GCC_DEC_FLOATS_AUTO=y
# CT_CC_GCC_DEC_FLOATS_BID is not set
# CT_CC_GCC_DEC_FLOATS_DPD is not set
# CT_CC_GCC_DEC_FLOATS_NO is not set
CT_CC_GCC_DEC_FLOATS=""
CT_ALL_CC_CHOICES="GCC"
#
# Additional supported languages:
#
CT_CC_LANG_CXX=y
# CT_CC_LANG_FORTRAN is not set
# end of C compiler
#
# Linkers
#
#
# BFD enabled in binutils
#
# CT_LINKER_MOLD is not set
CT_ALL_LINKER_CHOICES="MOLD"
# end of Linkers
#
# Debug facilities
#
# CT_DEBUG_DUMA is not set
# CT_DEBUG_GDB is not set
# CT_DEBUG_LTRACE is not set
# CT_DEBUG_STRACE is not set
CT_ALL_DEBUG_CHOICES="DUMA GDB LTRACE STRACE"
# end of Debug facilities
#
# Companion libraries
#
# CT_COMPLIBS_CHECK is not set
# CT_COMP_LIBS_CLOOG is not set
# CT_COMP_LIBS_EXPAT is not set
CT_COMP_LIBS_GETTEXT=y
CT_COMP_LIBS_GETTEXT_PKG_KSYM="GETTEXT"
CT_GETTEXT_DIR_NAME="gettext"
CT_GETTEXT_PKG_NAME="gettext"
CT_GETTEXT_SRC_RELEASE=y
# CT_GETTEXT_SRC_DEVEL is not set
CT_GETTEXT_PATCH_ORDER="global"
CT_GETTEXT_V_0_26=y
# CT_GETTEXT_V_0_23_1 is not set
# CT_GETTEXT_V_0_22_5 is not set
# CT_GETTEXT_V_0_21 is not set
# CT_GETTEXT_V_0_20_1 is not set
# CT_GETTEXT_V_0_19_8_1 is not set
CT_GETTEXT_VERSION="0.26"
CT_GETTEXT_MIRRORS="$(CT_Mirrors GNU gettext)"
CT_GETTEXT_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_GETTEXT_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_GETTEXT_ARCHIVE_FORMATS=".tar.xz .tar.gz"
CT_GETTEXT_SIGNATURE_FORMAT="packed/.sig"
CT_GETTEXT_later_than_0_23=y
CT_GETTEXT_0_23_or_later=y
CT_GETTEXT_later_than_0_21=y
CT_GETTEXT_0_21_or_later=y
CT_GETTEXT_INCOMPATIBLE_WITH_UCLIBC_NG=y
#
# This version of gettext is not compatible with uClibc-NG. Select
#
#
# a different version if uClibc-NG is used on the target or (in a
#
#
# Canadian cross build) on the host.
#
CT_COMP_LIBS_GMP=y
CT_COMP_LIBS_GMP_PKG_KSYM="GMP"
CT_GMP_DIR_NAME="gmp"
CT_GMP_PKG_NAME="gmp"
CT_GMP_SRC_RELEASE=y
# CT_GMP_SRC_DEVEL is not set
CT_GMP_PATCH_ORDER="global"
CT_GMP_V_6_3=y
# CT_GMP_V_6_2 is not set
# CT_GMP_V_6_1 is not set
CT_GMP_VERSION="6.3.0"
CT_GMP_MIRRORS="https://gmplib.org/download/gmp https://gmplib.org/download/gmp/archive $(CT_Mirrors GNU gmp)"
CT_GMP_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_GMP_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_GMP_ARCHIVE_FORMATS=".tar.xz .tar.lz .tar.bz2"
CT_GMP_SIGNATURE_FORMAT="packed/.sig"
CT_GMP_EXTRA_CFLAGS="-std=gnu17"
CT_COMP_LIBS_ISL=y
CT_COMP_LIBS_ISL_PKG_KSYM="ISL"
CT_ISL_DIR_NAME="isl"
CT_ISL_PKG_NAME="isl"
CT_ISL_SRC_RELEASE=y
# CT_ISL_SRC_DEVEL is not set
CT_ISL_PATCH_ORDER="global"
CT_ISL_V_0_27=y
# CT_ISL_V_0_26 is not set
# CT_ISL_V_0_25 is not set
# CT_ISL_V_0_24 is not set
# CT_ISL_V_0_23 is not set
# CT_ISL_V_0_22 is not set
# CT_ISL_V_0_21 is not set
# CT_ISL_V_0_20 is not set
# CT_ISL_V_0_19 is not set
# CT_ISL_V_0_18 is not set
# CT_ISL_V_0_17 is not set
# CT_ISL_V_0_16 is not set
# CT_ISL_V_0_15 is not set
# CT_ISL_V_0_11 is not set
CT_ISL_VERSION="0.27"
CT_ISL_MIRRORS="https://libisl.sourceforge.io"
CT_ISL_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ISL_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ISL_ARCHIVE_FORMATS=".tar.xz .tar.bz2 .tar.gz"
CT_ISL_SIGNATURE_FORMAT=""
CT_ISL_later_than_0_18=y
CT_ISL_0_18_or_later=y
CT_ISL_later_than_0_15=y
CT_ISL_0_15_or_later=y
# CT_COMP_LIBS_LIBELF is not set
CT_COMP_LIBS_LIBICONV=y
CT_COMP_LIBS_LIBICONV_PKG_KSYM="LIBICONV"
CT_LIBICONV_DIR_NAME="libiconv"
CT_LIBICONV_PKG_NAME="libiconv"
CT_LIBICONV_SRC_RELEASE=y
# CT_LIBICONV_SRC_DEVEL is not set
CT_LIBICONV_PATCH_ORDER="global"
CT_LIBICONV_V_1_18=y
# CT_LIBICONV_V_1_16 is not set
# CT_LIBICONV_V_1_15 is not set
CT_LIBICONV_VERSION="1.18"
CT_LIBICONV_MIRRORS="$(CT_Mirrors GNU libiconv)"
CT_LIBICONV_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_LIBICONV_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_LIBICONV_ARCHIVE_FORMATS=".tar.gz"
CT_LIBICONV_SIGNATURE_FORMAT="packed/.sig"
CT_COMP_LIBS_MPC=y
CT_COMP_LIBS_MPC_PKG_KSYM="MPC"
CT_MPC_DIR_NAME="mpc"
CT_MPC_PKG_NAME="mpc"
CT_MPC_SRC_RELEASE=y
# CT_MPC_SRC_DEVEL is not set
CT_MPC_PATCH_ORDER="global"
CT_MPC_V_1_3=y
CT_MPC_VERSION="1.3.1"
CT_MPC_MIRRORS="https://www.multiprecision.org/downloads $(CT_Mirrors GNU mpc)"
CT_MPC_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_MPC_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_MPC_ARCHIVE_FORMATS=".tar.gz"
CT_MPC_SIGNATURE_FORMAT="packed/.sig"
CT_COMP_LIBS_MPFR=y
CT_COMP_LIBS_MPFR_PKG_KSYM="MPFR"
CT_MPFR_DIR_NAME="mpfr"
CT_MPFR_PKG_NAME="mpfr"
CT_MPFR_SRC_RELEASE=y
# CT_MPFR_SRC_DEVEL is not set
CT_MPFR_PATCH_ORDER="global"
CT_MPFR_V_4_2=y
CT_MPFR_VERSION="4.2.2"
CT_MPFR_MIRRORS="https://www.mpfr.org/mpfr-${CT_MPFR_VERSION} $(CT_Mirrors GNU mpfr)"
CT_MPFR_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_MPFR_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_MPFR_ARCHIVE_FORMATS=".tar.xz .tar.bz2 .tar.gz .zip"
CT_MPFR_SIGNATURE_FORMAT="packed/.asc"
CT_COMP_LIBS_NCURSES=y
CT_COMP_LIBS_NCURSES_PKG_KSYM="NCURSES"
CT_NCURSES_DIR_NAME="ncurses"
CT_NCURSES_PKG_NAME="ncurses"
CT_NCURSES_SRC_RELEASE=y
# CT_NCURSES_SRC_DEVEL is not set
CT_NCURSES_PATCH_ORDER="global"
CT_NCURSES_V_6_5=y
# CT_NCURSES_V_6_4 is not set
# CT_NCURSES_V_6_2 is not set
# CT_NCURSES_V_6_1 is not set
# CT_NCURSES_V_6_0 is not set
CT_NCURSES_VERSION="6.5"
CT_NCURSES_MIRRORS="https://invisible-mirror.net/archives/ncurses $(CT_Mirrors GNU ncurses)"
CT_NCURSES_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_NCURSES_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_NCURSES_ARCHIVE_FORMATS=".tar.gz"
CT_NCURSES_SIGNATURE_FORMAT="packed/.asc"
CT_NCURSES_NEW_ABI=y
CT_NCURSES_HOST_CONFIG_ARGS=""
CT_NCURSES_HOST_DISABLE_DB=y
CT_NCURSES_HOST_FALLBACKS="linux,xterm,xterm-color,xterm-256color,vt100"
CT_NCURSES_TARGET_CONFIG_ARGS=""
# CT_NCURSES_TARGET_DISABLE_DB is not set
CT_NCURSES_TARGET_FALLBACKS=""
CT_NCURSES_EXTRA_CFLAGS="-std=gnu17"
CT_COMP_LIBS_ZLIB=y
CT_COMP_LIBS_ZLIB_PKG_KSYM="ZLIB"
CT_ZLIB_DIR_NAME="zlib"
CT_ZLIB_PKG_NAME="zlib"
CT_ZLIB_SRC_RELEASE=y
# CT_ZLIB_SRC_DEVEL is not set
CT_ZLIB_PATCH_ORDER="global"
CT_ZLIB_V_1_3_1=y
# CT_ZLIB_V_1_2_13 is not set
CT_ZLIB_VERSION="1.3.1"
CT_ZLIB_MIRRORS="https://github.com/madler/zlib/releases/download/v${CT_ZLIB_VERSION} https://www.zlib.net/"
CT_ZLIB_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_FORMATS=".tar.xz .tar.gz"
CT_ZLIB_SIGNATURE_FORMAT="packed/.asc"
CT_COMP_LIBS_ZSTD=y
CT_COMP_LIBS_ZSTD_PKG_KSYM="ZSTD"
CT_ZSTD_DIR_NAME="zstd"
CT_ZSTD_PKG_NAME="zstd"
CT_ZSTD_SRC_RELEASE=y
# CT_ZSTD_SRC_DEVEL is not set
CT_ZSTD_PATCH_ORDER="global"
CT_ZSTD_V_1_5_7=y
# CT_ZSTD_V_1_5_6 is not set
# CT_ZSTD_V_1_5_5 is not set
# CT_ZSTD_V_1_5_2 is not set
CT_ZSTD_VERSION="1.5.7"
CT_ZSTD_MIRRORS="https://github.com/facebook/zstd/releases/download/v${CT_ZSTD_VERSION} https://downloads.sourceforge.net/project/zstandard.mirror/v${CT_ZSTD_VERSION}"
CT_ZSTD_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZSTD_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ZSTD_ARCHIVE_FORMATS=".tar.gz"
CT_ZSTD_SIGNATURE_FORMAT="packed/.sig"
CT_ALL_COMP_LIBS_CHOICES="CLOOG EXPAT GETTEXT GMP GNUPRUMCU ISL LIBELF LIBICONV MPC MPFR NCURSES NEWLIB_NANO PICOLIBC ZLIB ZSTD"
CT_LIBICONV_NEEDED=y
CT_GETTEXT_NEEDED=y
CT_GMP_NEEDED=y
CT_MPFR_NEEDED=y
CT_ISL_NEEDED=y
CT_MPC_NEEDED=y
CT_NCURSES_NEEDED=y
CT_ZLIB_NEEDED=y
CT_ZSTD_NEEDED=y
CT_LIBICONV=y
CT_GETTEXT=y
CT_GMP=y
CT_MPFR=y
CT_ISL=y
CT_MPC=y
CT_NCURSES=y
CT_ZLIB=y
CT_ZSTD=y
# end of Companion libraries
#
# Companion tools
#
# CT_COMP_TOOLS_FOR_HOST is not set
# CT_COMP_TOOLS_AUTOCONF is not set
# CT_COMP_TOOLS_AUTOMAKE is not set
# CT_COMP_TOOLS_BISON is not set
# CT_COMP_TOOLS_DTC is not set
# CT_COMP_TOOLS_LIBTOOL is not set
# CT_COMP_TOOLS_M4 is not set
# CT_COMP_TOOLS_MAKE is not set
CT_ALL_COMP_TOOLS_CHOICES="AUTOCONF AUTOMAKE BISON DTC LIBTOOL M4 MAKE"
# end of Companion tools

View File

@ -0,0 +1,7 @@
set timeout=0
set default=0
menuentry "NFDOS Kernel" {
multiboot /boot/nfdos.elf
boot
}

Binary file not shown.

View File

@ -0,0 +1,7 @@
set timeout=0
set default=0
menuentry "NFDOS Kernel" {
multiboot /boot/nfdos.elf
boot
}

26
src/_nfdos/init Executable file
View File

@ -0,0 +1,26 @@
#!/bin/sh
mount -t proc proc /proc
mount -t sysfs sys /sys
mount -t devtmpfs devtmpfs /dev
if [ -f /opt/kernel/neurotron/neurotron_main.py ]; then
export PYTHONHOME=/usr
export PYTHONPATH=/usr/lib/python3.13:/usr/lib/python3.13/site-packages
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
echo '👉 Inicializando hipocampo físico...'
/usr/bin/python3 /opt/kernel/neurotron/neurotron_core/disk_init.py
echo '👉 Inicializando o Neurotron...'
/usr/bin/python3 /opt/kernel/neurotron/neurotron_main.py || echo "⚠️ Neurotron falhou" &
sleep 5
echo '👉 Inicializando Painel de Telemetria do Neurotron...'
/usr/bin/python3 /opt/kernel/neurotron/neurotron_core/telemetry_tail.py
else
echo '⚙️ BusyBox ativo — Neurotron ausente.'
fi
exec /bin/sh

BIN
src/_nfdos/iso/boot/bzImage Normal file

Binary file not shown.

View File

@ -0,0 +1,21 @@
# NFDOS GRUB2 configuration
set timeout=3
set default=0
# Parâmetros padrão do kernel (ajustáveis)
set kernelopts="console=ttyS0 earlyprintk=serial,ttyS0,115200 keep_bootcon loglevel=8"
menuentry 'NFDOS Linux (Serial Console)' {
linux /boot/bzImage root=/dev/ram0 ${kernelopts}
initrd /boot/initramfs.cpio.gz
}
menuentry 'NFDOS Linux (Serial Console + Force Format)' {
linux /boot/bzImage root=/dev/ram0 ${kernelopts} nfdos_force_format=1
initrd /boot/initramfs.cpio.gz
}
menuentry 'NFDOS Linux (Standard VGA)' {
linux /boot/bzImage root=/dev/ram0 quiet ${kernelopts}
initrd /boot/initramfs.cpio.gz
}

27
src/_nfdos/kernel/boot.S Normal file
View File

@ -0,0 +1,27 @@
/* Entrada em 32-bit (GRUB carrega em protected mode) */
.intel_syntax noprefix
.section .text
.code32
.global _start
.extern kernel_main
/* pilha simples */
.section .bss
.align 16
.global _stack_top
_stack_bottom:
.skip 16384 /* 16 KiB */
_stack_top:
.section .text
_start:
/* setar a pilha */
mov esp, offset _stack_top
/* chamar o C */
call kernel_main
halt:
cli
hlt
jmp halt

BIN
src/_nfdos/kernel/boot.o Normal file

Binary file not shown.

BIN
src/_nfdos/kernel/kernel.elf Executable file

Binary file not shown.

13
src/_nfdos/kernel/kmain.c Normal file
View File

@ -0,0 +1,13 @@
#include <stdint.h>
#include <stddef.h>
#include "vga.h"
enum { COLOR_LIGHT_GREY = 0x07, COLOR_GREEN = 0x0A, COLOR_CYAN = 0x0B };
void kernel_main(void) {
vga_clear(COLOR_LIGHT_GREY);
vga_write_str("NFDOS Kernel iniciado!\n", COLOR_GREEN);
vga_write_str("Boot via GRUB (Multiboot v1), modo 32-bit OK.\n", COLOR_CYAN);
for(;;) { __asm__ __volatile__("hlt"); }
}

BIN
src/_nfdos/kernel/kmain.o Normal file

Binary file not shown.

View File

@ -0,0 +1,37 @@
OUTPUT_FORMAT(elf32-i386)
OUTPUT_ARCH(i386)
ENTRY(_start)
SECTIONS
{
/* Carregar o kernel a partir do 1MB */
. = 0x00100000;
/* A header Multiboot tem de estar nas primeiras 8KB do binário */
.multiboot :
{
KEEP(*(.multiboot))
KEEP(*(.multiboot.*))
}
.text :
{
*(.text .text.*)
}
.rodata :
{
*(.rodata .rodata.*)
}
.data :
{
*(.data .data.*)
}
.bss :
{
*(COMMON)
*(.bss .bss.*)
}
}

View File

@ -0,0 +1,10 @@
/* Multiboot v1 header simples (GRUB) */
.section .multiboot
.align 4
.set MB_MAGIC, 0x1BADB002
.set MB_FLAGS, 0x00000001 /* align modules on page boundaries */
.set MB_CHECK, -(MB_MAGIC + MB_FLAGS)
.long MB_MAGIC
.long MB_FLAGS
.long MB_CHECK

Binary file not shown.

View File

View File

@ -0,0 +1,185 @@
from __future__ import annotations
import json, os
from datetime import datetime, timezone
from rich.console import Console
from rich.table import Table
from pathlib import Path
from .neurotron_config import (
NEUROTRON_DATASET_PATH, NEUROTRON_HISTORY_KEEP, NEUROTRON_DIAG_SCHEMA,
HOMEOSTASIS_CPU_WARN, HOMEOSTASIS_CPU_ALERT,
HOMEOSTASIS_MEM_WARN, HOMEOSTASIS_MEM_ALERT,
HOMEOSTASIS_LOAD_WARN, HOMEOSTASIS_LOAD_ALERT,
)
from .perception import Perception
console = Console()
def _now_iso():
return datetime.now(timezone.utc).isoformat()
class AutoDiagnostic:
def __init__(self, runtime_dir: str, log_dir: str):
self.runtime_dir = runtime_dir
self.log_dir = log_dir
self.data_dir = Path(NEUROTRON_DATASET_PATH)
self.data_dir.mkdir(parents=True, exist_ok=True)
self.last_file = self.data_dir / "last_diagnostic.json"
self.perception = Perception()
self.current = None
self.previous = None
def _load_previous(self):
if not self.last_file.exists():
return None
try:
with open(self.last_file, "r") as f:
return json.load(f)
except Exception:
return None
def _save_current(self, payload: dict):
history = []
if self.last_file.exists():
try:
with open(self.last_file, "r") as f:
prev = json.load(f)
history = prev.get("history", [])
history.append({
"timestamp": prev.get("timestamp"),
"cpu_percent": prev.get("cpu_percent"),
"mem_percent": prev.get("mem_percent"),
"loadavg": prev.get("loadavg"),
"state": prev.get("state", "UNKNOWN"),
})
history = history[-NEUROTRON_HISTORY_KEEP:]
except Exception:
history = []
payload["history"] = history
with open(self.last_file, "w") as f:
json.dump(payload, f, indent=2)
def _classify_state(self, cpu, mem, l1):
# valores podem ser "?"
try:
cpu = float(cpu)
mem = float(mem)
l1 = float(l1)
except Exception:
return "UNKNOWN"
# ALERT/CRITICAL
if cpu >= HOMEOSTASIS_CPU_ALERT or mem >= HOMEOSTASIS_MEM_ALERT or l1 >= HOMEOSTASIS_LOAD_ALERT:
return "CRITICAL"
if cpu >= HOMEOSTASIS_CPU_WARN or mem >= HOMEOSTASIS_MEM_WARN or l1 >= HOMEOSTASIS_LOAD_WARN:
return "ALERT"
# OKs
return "STABLE"
def _delta(self, a, b):
try:
if isinstance(a, list) and isinstance(b, list) and len(a) == len(b):
return [round(float(x) - float(y), 2) for x, y in zip(a, b)]
return round(float(a) - float(b), 2)
except Exception:
return "?"
def _render_mini_trend(self, values, width=24, charset="▁▂▃▄▅▆▇█"):
if not values:
return ""
lo = min(values); hi = max(values)
if not isinstance(lo, (int, float)) or not isinstance(hi, (int, float)):
return ""
span = (hi - lo) or 1.0
levels = len(charset) - 1
bars = []
for v in values[-width:]:
if not isinstance(v, (int, float)):
bars.append("·")
continue
i = int(round((v - lo) / span * levels))
bars.append(charset[i])
return "".join(bars)
def run_exam(self):
console.print("\n[bold]🤖 Iniciando rotina de Auto-Diagnóstico Evolutivo...[/bold]\n")
snap = self.perception.snapshot()
cpu = snap.get("cpu_percent", "?")
mem = snap.get("mem_percent", "?")
load = snap.get("loadavg", ["?", "?", "?"])
prev = self._load_previous()
self.previous = prev
# deltas
cpu_prev = prev.get("cpu_percent") if prev else "?"
mem_prev = prev.get("mem_percent") if prev else "?"
load_prev = prev.get("loadavg") if prev else ["?", "?", "?"]
d_cpu = self._delta(cpu, cpu_prev)
d_mem = self._delta(mem, mem_prev)
d_load = self._delta(load, load_prev)
# estado
l1 = load[0] if isinstance(load, list) and load else "?"
state = self._classify_state(cpu, mem, l1)
# tabela
table = Table(title="🩺 Exame Clínico Evolutivo", show_lines=True)
table.add_column("Sinal Vital")
table.add_column("Atual", justify="right")
table.add_column("Δ", justify="center")
table.add_column("Anterior", justify="right")
def fmt(v):
if isinstance(v, list):
return str(v)
return str(v)
table.add_row("CPU (%)", fmt(cpu), fmt(d_cpu), fmt(cpu_prev))
table.add_row("Memória (%)", fmt(mem), fmt(d_mem), fmt(mem_prev))
table.add_row("Carga média (1/5/15)", fmt(load), "" if d_load == "?" else fmt(d_load), fmt(load_prev))
console.print(table)
payload = {
"schema": NEUROTRON_DIAG_SCHEMA,
"timestamp": _now_iso(),
"cpu_percent": cpu,
"mem_percent": mem,
"loadavg": load,
"state": state,
"env": {
"user": snap.get("env_user"),
"term": snap.get("env_term"),
},
}
self._save_current(payload)
console.print(f"[green]✔ Histórico evolutivo atualizado em:[/green] \n{self.last_file}")
# Atualiza telemetria contínua
try:
telemetry_file = Path(NEUROTRON_DATASET_PATH) / "telemetry.json"
telemetry_file.parent.mkdir(parents=True, exist_ok=True)
telemetry = []
if telemetry_file.exists():
telemetry = json.loads(telemetry_file.read_text() or "[]")
telemetry.append({
"timestamp": payload["timestamp"],
"cpu": payload.get("cpu_percent"),
"mem": payload.get("mem_percent"),
"load": payload.get("loadavg"),
"state": payload.get("state"),
})
telemetry = telemetry[-128:] # manter últimas 128 amostras
telemetry_file.write_text(json.dumps(telemetry, indent=2))
except Exception as e:
console.print(f"[yellow]⚠️ Falha ao atualizar telemetria:[/] {e}")
return state, payload

View File

@ -0,0 +1,230 @@
import json
import time
from collections import defaultdict, deque
from pathlib import Path
from time import sleep
from rich.console import Console
from neuron import Neuron
from hippocampus import Hippocampus
from perception import Perception
from motor import Motor
from .neurotron_config import (
NEUROTRON_MODE, NEUROTRON_TICK, NEUROTRON_TICK_MIN, NEUROTRON_TICK_MAX, NEUROTRON_TICK_STEP,
NEUROTRON_DIAG_EVERY_TICKS, NEUROTRON_DATASET_PATH,
HEARTBEAT_ENABLED, HEARTBEAT_STYLE, NEUROTRON_THRESHOLDS,
TELEMETRY_MAXLEN, TELEMETRY_FLUSH_EVERY_TICKS,
)
from .autodiagnostic import AutoDiagnostic
class VitalSigns(Neuron):
name = "VitalSigns"
def observe(self) -> None:
snap = self.ctx.perception.snapshot()
self.publish("vitals", snap)
self.ctx.memory.remember("observe.vitals", snap)
class EchoAgent(Neuron):
name = "EchoAgent"
def think(self) -> None:
msg = self.consume("vitals")
if msg:
self.publish("actions", {"action": "echo", "text": f"CPU {msg.get('cpu_percent', '?')}%"})
class Cortex:
"""
Orquestrador: liga neurónios, bus de mensagens, memória, IO e ciclo cognitivo.
Agora com Telemetria Contínua (V5): heartbeat, microalertas e flush periódico.
"""
def __init__(self, runtime_dir, log_dir, tick_seconds=NEUROTRON_TICK):
self.runtime_dir = runtime_dir
self.log_dir = log_dir
self.tick = float(tick_seconds)
self.mode = NEUROTRON_MODE
self._tick_count = 0
self.diagnostic = AutoDiagnostic(runtime_dir, log_dir)
self.console = Console()
self.memory = Hippocampus(log_dir=log_dir)
self.perception = Perception()
self.motor = Motor()
# Message bus simples: channels → deque
self.bus = defaultdict(lambda: deque(maxlen=32))
# Telemetria em memória (curto prazo)
self.telemetry = deque(maxlen=TELEMETRY_MAXLEN)
# Regista neurónios (podes adicionar mais à medida)
self.neurons: list[Neuron] = [
VitalSigns(self),
EchoAgent(self),
]
self._booted = False
# Caminho para gravar a telemetria
self.telemetry_path = Path(NEUROTRON_DATASET_PATH) / "telemetry.json"
self.telemetry_path.parent.mkdir(parents=True, exist_ok=True)
# ——— ciclo de vida ———
def boot(self) -> None:
if self._booted:
return
self.console.print("[bold cyan]🧠 Neurotron[/] — boot")
self.memory.remember("boot", {"version": "0.1", "tick": self.tick})
self._booted = True
state, _ = self.diagnostic.run_exam()
self._apply_homeostasis(state)
def _apply_homeostasis(self, state):
if state == "CRITICAL":
self.mode = "diagnostic"
self.tick = min(NEUROTRON_TICK_MAX, self.tick + NEUROTRON_TICK_STEP)
elif state == "ALERT":
self.tick = min(NEUROTRON_TICK_MAX, self.tick + NEUROTRON_TICK_STEP / 2)
elif state == "STABLE":
self.tick = max(NEUROTRON_TICK_MIN, self.tick - NEUROTRON_TICK_STEP / 2)
# UNKNOWN → não mexe
def shutdown(self, reason: str = ""):
self.console.print(f"[yellow]shutdown:[/] {reason}")
self.memory.remember("shutdown", {"reason": reason})
def fatal(self, e: Exception):
self.console.print(f"[red]fatal:[/] {e!r}")
self.memory.remember("fatal", {"error": repr(e)})
print(f"fatal: {repr(e)}")
raise
# ——— loop ———
def observe(self) -> None:
for n in self.neurons:
n.observe()
def think(self) -> None:
for n in self.neurons:
n.think()
def act(self) -> None:
# Consumir ações agregadas e executar
action = self.bus_consume("actions")
if action and action.get("action") == "echo":
res = self.motor.run("echo", [action.get("text", "")])
self.memory.remember("act.echo", res)
if res.get("stdout"):
self.console.print(f"[green]{res['stdout'].strip()}[/]")
def rest(self):
# Heartbeat e microalertas antes de dormir
if HEARTBEAT_ENABLED:
self._heartbeat_and_telemetry()
# Pausa regulada
sleep(self.tick)
# Contador e rotinas periódicas
self._tick_count += 1
if self._tick_count % NEUROTRON_DIAG_EVERY_TICKS == 0:
state, _ = self.diagnostic.run_exam()
self._apply_homeostasis(state)
if self._tick_count % TELEMETRY_FLUSH_EVERY_TICKS == 0:
self._flush_telemetry()
# ——— telemetria/alertas ———
def _heartbeat_and_telemetry(self):
snap = self.perception.snapshot()
cpu = snap.get("cpu_percent", "?")
mem = (snap.get("mem") or {}).get("percent", "?")
load = snap.get("loadavg") or []
# Adiciona ao buffer de telemetria
self.telemetry.append({
"ts": time.time(),
"cpu": cpu,
"mem": mem,
"load": load,
"tick": self.tick,
})
# Microalertas com base nos limiares
self._evaluate_microalerts(cpu, mem, load)
# Heartbeat visual
color = self._color_for_levels(cpu, mem, load)
if HEARTBEAT_STYLE == "compact":
self.console.print(f"[bold {color}]💓[/] CPU: {cpu}% | MEM: {mem}% | TICK: {self.tick:.2f}s")
else:
self.console.print(
f"[bold {color}]💓 [Heartbeat][/bold {color}] "
f"CPU: {cpu}% | MEM: {mem}% | LOAD: {load} | TICK: {self.tick:.2f}s | MODE: {self.mode}"
)
def _evaluate_microalerts(self, cpu, mem, load):
alerts = []
# Normaliza
load1 = load[0] if (isinstance(load, (list, tuple)) and load) else None
try:
if isinstance(cpu, (int, float)) and cpu >= NEUROTRON_THRESHOLDS["cpu_high"]:
alerts.append(("cpu", cpu))
if isinstance(mem, (int, float)) and mem >= NEUROTRON_THRESHOLDS["mem_high"]:
alerts.append(("mem", mem))
if isinstance(load1, (int, float)) and load1 >= NEUROTRON_THRESHOLDS["load1_high"]:
alerts.append(("load1", load1))
except KeyError:
pass # thresholds incompletos → sem microalertas
if not alerts:
return
for (metric, value) in alerts:
self.console.print(f"[yellow]⚠️ Microalerta:[/] {metric.upper()} {value} — ajustando homeostase (tick +{NEUROTRON_TICK_STEP:.2f}s)")
# Ajuste simples de segurança
self.tick = min(NEUROTRON_TICK_MAX, self.tick + NEUROTRON_TICK_STEP)
self.memory.remember("microalert", {
"ts": time.time(),
"alerts": alerts,
"new_tick": self.tick,
})
def _color_for_levels(self, cpu, mem, load):
# Heurística simples de cor
try:
load1 = load[0] if (isinstance(load, (list, tuple)) and load) else 0.0
high = (
(isinstance(cpu, (int, float)) and cpu >= NEUROTRON_THRESHOLDS["cpu_high"]) or
(isinstance(mem, (int, float)) and mem >= NEUROTRON_THRESHOLDS["mem_high"]) or
(isinstance(load1, (int, float)) and load1 >= NEUROTRON_THRESHOLDS["load1_high"])
)
if high:
return "yellow"
except Exception:
pass
return "green"
def _flush_telemetry(self):
# Grava o buffer de telemetria em JSON (mantendo histórico curto)
try:
data = list(self.telemetry)
with self.telemetry_path.open("w") as f:
json.dump(data, f)
self.memory.remember("telemetry.flush", {"count": len(data), "path": str(self.telemetry_path)})
except Exception as e:
self.console.print(f"[red]✖ Falha ao gravar telemetria:[/] {e!r}")
self.memory.remember("telemetry.error", {"error": repr(e)})
# ——— bus ———
def bus_publish(self, channel: str, payload: dict) -> None:
self.bus[channel].append(payload)
def bus_consume(self, channel: str) -> dict | None:
q = self.bus[channel]
return q.popleft() if q else None

View File

@ -0,0 +1,259 @@
#!/usr/bin/env python3
"""
💾 Módulo de Inicialização de Disco Neurotron V0.1 (atualizado)
Detecta, avalia, prepara e monta o disco persistente do NFDOS.
- Não formata discos que contenham um filesystem conhecido, a menos que forçado.
- Forçar formatação:
* EXPORT: export NFDOS_FORCE_FORMAT=1 (no ambiente do initramfs, se aplicável)
* Kernel cmdline: adicionar `nfdos_force_format=1` ao -append do QEMU
"""
import os
import subprocess
from pathlib import Path
from rich.console import Console
if __name__ == "__main__" and __package__ is None:
import sys
from pathlib import Path
sys.path.append(str(Path(__file__).resolve().parents[1]))
__package__ = "neurotron_core"
from .neurotron_config import (
MOUNT_POINT, DISK_CANDIDATES
)
console = Console()
def run(cmd: list[str]) -> bool:
"""Executa comando silenciosamente (retorna True se OK)."""
try:
subprocess.run(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check=True)
return True
except (subprocess.CalledProcessError, FileNotFoundError):
return False
def detect_disk() -> str | None:
"""Procura por um dispositivo de disco válido (por ordem em DISK_CANDIDATES)."""
for dev in DISK_CANDIDATES:
p = Path(dev)
if p.exists():
console.print(f"[cyan]🔍 Detetado disco:[/] {dev}")
return dev
console.print("[yellow]⚠️ Nenhum disco detectado.[/yellow]")
return None
def blkid_check(device: str) -> str | None:
"""Tenta obter tipo com blkid (se disponível)."""
try:
out = subprocess.run(["blkid", device], stdout=subprocess.PIPE, text=True, check=False)
return out.stdout.strip() if out.stdout else None
except FileNotFoundError:
return None
def read_sig(device: str, size: int = 2048) -> bytes | None:
"""Lê os primeiros `size` bytes do device (se possível)."""
try:
with open(device, "rb") as f:
return f.read(size)
except Exception:
return None
def detect_fs_by_magic(device: str) -> str | None:
"""
Detecta assinaturas simples:
- ext4 superblock magic (0xEF53) @ offset 1024 + 56 = 1080
- NTFS -> 'NTFS ' @ offset 3
- FAT32 -> 'FAT32' nos offsets típicos do boot sector
- MBR partition table signature 0x55AA @ offset 510-511
Retorna string com o sistema ou None.
"""
buf = read_sig(device, size=4096)
if not buf:
return None
# MBR signature
if len(buf) >= 512 and buf[510:512] == b'\x55\xAA':
# detecta tabela de partições existente (MBR)
return "mbr-partition-table"
# ext magic at 1024+56 = 1080
if len(buf) >= 1082 and buf[1080:1082] == b'\x53\xEF':
return "ext (superblock)"
# NTFS signature at offset 3 (ASCII "NTFS ")
if len(buf) >= 11 and buf[3:11] == b'NTFS ':
return "ntfs"
# FAT32 signature at offset 82 or boot sector strings containing FAT
if b"FAT32" in buf or b"FAT16" in buf or b"FAT12" in buf:
return "fat"
return None
def parse_cmdline_flag() -> bool:
"""Lê /proc/cmdline para a flag nfdos_force_format=1"""
try:
with open("/proc/cmdline", "r") as f:
cmd = f.read()
return "nfdos_force_format=1" in cmd.split()
except Exception:
return False
def which(prog: str) -> str | None:
for p in os.environ.get("PATH", "/sbin:/bin:/usr/sbin:/usr/bin").split(":"):
cand = Path(p) / prog
if cand.exists() and os.access(cand, os.X_OK):
return str(cand)
return None
def format_ext4(device: str, label: str = "NFDOS_DATA") -> bool:
"""Formata o dispositivo com ext4, recolhendo logs de erro detalhados (BusyBox-safe)."""
mke2fs = which("mke2fs")
mkfs_ext4 = which("mkfs.ext4")
mkfs = which("mkfs")
candidates = []
if mkfs_ext4:
candidates.append(([mkfs_ext4, "-F", "-L", label, device], "mkfs.ext4"))
if mke2fs:
# o BusyBox mke2fs não aceita '-t', por isso ajustaremos dentro do loop
candidates.append(([mke2fs, "-F", "-t", "ext4", "-L", label, device], "mke2fs"))
if mkfs:
candidates.append(([mkfs, "-t", "ext4", "-F", "-L", label, device], "mkfs"))
if not candidates:
console.print("[red]❌ Nenhum utilitário mkfs disponível no initramfs![/red]")
return False
for cmd, name in candidates:
console.print(f"[yellow]⚙️ Formatando {device} com {name}...[/yellow]")
# 👉 se for o BusyBox mke2fs, removemos o argumento -t
if name == "mke2fs":
cmd = [c for c in cmd if c != "-t" and c != "ext4"]
try:
result = subprocess.run(
cmd,
text=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
check=True,
)
if result.stdout:
console.print(result.stdout.strip())
console.print(f"[green]✔ Formatação concluída com {name}.[/green]")
return True
except subprocess.CalledProcessError as e:
console.print(f"[red]❌ {name} falhou (código {e.returncode}).[/red]")
if e.stdout:
console.print(f"[cyan]📜 STDOUT:[/cyan]\n{e.stdout.strip()}")
if e.stderr:
console.print(f"[magenta]⚠️ STDERR:[/magenta]\n{e.stderr.strip()}")
console.print("[red]❌ Nenhum método de formatação teve sucesso.[/red]")
console.print("[cyan]🧠 Sugestão:[/] verifique se o kernel suporta EXT4 e se o BusyBox inclui mke2fs.")
return False
def ensure_fs(device: str) -> bool:
"""
Verifica se existe sistema de ficheiros.
Se não existir e houver confirmação/flag, formata ext4 (ou fallback via mke2fs).
"""
# 1⃣ tentativa rápida com blkid
info = blkid_check(device)
if info:
console.print(f"[green]🧠 Disco já formatado (blkid):[/] {info}")
return True
# 2⃣ fallback por leituras de assinatura
sig = detect_fs_by_magic(device)
if sig:
console.print(f"[yellow]⚠ Assinatura detectada no disco:[/] {sig}")
console.print("[red]❗ O disco contém dados ou partições existentes. Abortando formatação.[/red]")
return False
# 3⃣ se nada detectado — disco virgem
forced_env = os.environ.get("NFDOS_FORCE_FORMAT") == "1"
forced_cmd = parse_cmdline_flag()
if not (forced_env or forced_cmd):
console.print("[yellow]⚠ Disco parece virgem, mas não há confirmação para formatar.[/yellow]")
console.print("Use `nfdos_force_format=1` no kernel cmdline ou export NFDOS_FORCE_FORMAT=1")
console.print("para permitir formatação automática.")
return False
# 4⃣ tentar formatação
console.print(f"[yellow]⚙️ Forçando formatação de {device} como ext4 (FLAG DETETADA)...[/yellow]")
ok = format_ext4(device)
if ok:
console.print("[green]✔ Formatação concluída com sucesso.[/green]")
return True
# 5⃣ se nada funcionou
console.print("[red]❌ Falha na formatação.[/red]")
console.print("[cyan]🧠 Sugestão:[/] verifique se o kernel inclui suporte para EXT4 ou se o mkfs/mke2fs está embutido no BusyBox.")
return False
def mount_disk(device: str) -> bool:
"""Monta o disco no ponto esperado (retorna True se OK)."""
os.makedirs(MOUNT_POINT, exist_ok=True)
return run(["mount", device, MOUNT_POINT])
def debug_env():
"""Mostra informações úteis quando nenhum disco é detectado (ou para debug)."""
console.print("[yellow]🩻 DEBUG: listando /dev/* e últimas mensagens do kernel[/yellow]")
devs = sorted(Path("/dev").glob("*"))
console.print("📂 Dispositivos disponíveis:", ", ".join([d.name for d in devs if d.is_char_device() or d.is_block_device()]))
os.system("dmesg | tail -n 20 || echo '(dmesg não disponível)'")
console.print("[yellow]───────────────────────────────[/yellow]")
os.system("echo '--- /proc/partitions ---'; cat /proc/partitions || true")
os.system("echo '--- dmesg | grep -i virtio ---'; dmesg | grep -i virtio || true")
console.print("[yellow]───────────────────────────────[/yellow]")
def initialize_persistence():
"""Fluxo completo de inicialização do hipocampo físico."""
device = detect_disk()
if not device:
debug_env()
console.print("[red]❌ Nenhum disco físico encontrado — usando modo RAM.[/red]")
return False
if not ensure_fs(device):
console.print("[red]❌ Preparação do sistema de ficheiros foi interrompida.[/red]")
return False
if not mount_disk(device):
console.print("[red]❌ Falha ao montar disco.[/red]")
return False
console.print(f"[green]✔ Disco montado em:[/] {MOUNT_POINT}")
telemetry_file = Path("/opt/kernel/neurotron/data/telemetry.json")
telemetry_file.parent.mkdir(parents=True, exist_ok=True)
if not telemetry_file.exists():
telemetry_file.write_text("[]")
for d in ["data", "logs", "dna"]:
Path(MOUNT_POINT, d).mkdir(parents=True, exist_ok=True)
Path(MOUNT_POINT, "DNA_ID").write_text("NEUROTRON_HIPOCAMPUS_V1\n")
console.print("[cyan]👉 Hipocampo físico inicializado com sucesso.[/cyan]")
return True
if __name__ == "__main__":
initialize_persistence()

View File

@ -0,0 +1,34 @@
from pathlib import Path
from datetime import datetime
try:
import orjson as json
except Exception: # fallback leve
import json # type: ignore
class Hippocampus:
"""
Memória contextual simples (JSON Lines): append-only.
Guarda perceções, decisões e ações para replays futuros.
"""
def __init__(self, log_dir: Path):
self.log_dir = log_dir
self.events_file = log_dir / "events.jsonl"
def remember(self, kind: str, data: dict) -> None:
rec = {
"ts": datetime.utcnow().isoformat() + "Z",
"kind": kind,
"data": data,
}
try:
if "orjson" in json.__name__:
blob = json.dumps(rec)
else:
blob = json.dumps(rec) # type: ignore
with self.events_file.open("ab") as f:
f.write(blob if isinstance(blob, bytes) else blob.encode("utf-8"))
f.write(b"\n")
except Exception:
# evitar crash por IO em early boot
pass

View File

@ -0,0 +1,27 @@
import subprocess
class Motor:
"""
Ator do sistema: executa comandos controlados (whitelist).
Mantém-se minimal até termos política de segurança mais rica.
"""
SAFE_CMDS = {
"echo": ["echo"],
"sh": ["/bin/sh"], # shell interativo (init)
}
def run(self, cmd: str, args: list[str] | None = None) -> dict:
prog = self.SAFE_CMDS.get(cmd)
if not prog:
return {"ok": False, "error": f"cmd '{cmd}' não permitido"}
try:
full = prog + (args or [])
res = subprocess.run(full, capture_output=True, text=True)
return {
"ok": res.returncode == 0,
"code": res.returncode,
"stdout": res.stdout,
"stderr": res.stderr,
}
except Exception as e:
return {"ok": False, "error": str(e)}

View File

@ -0,0 +1,30 @@
from typing import Any, Dict
class Neuron:
"""
Classe-base de um neurónio-agente.
Cada neurónio pode observar/agir e trocar mensagens via o bus do Cortex.
"""
name = "Neuron"
def __init__(self, ctx: "Cortex"):
self.ctx = ctx
def observe(self) -> None:
"""Ler estado do mundo (sensores, /proc, eventos)."""
return
def think(self) -> None:
"""Processar/planejar usando o estado atual."""
return
def act(self) -> None:
"""Executar uma ação (opcional)."""
return
# Utilitários
def publish(self, channel: str, payload: Dict[str, Any]) -> None:
self.ctx.bus_publish(channel, payload)
def consume(self, channel: str) -> Dict[str, Any] | None:
return self.ctx.bus_consume(channel)

View File

@ -0,0 +1,124 @@
"""
🧠 neurotron_config.py
NFDOS Núcleo de parâmetros vitais do Neurotron
------------------------------------------------
Este ficheiro centraliza todos os ajustes simbólicos e técnicos
do ciclo cognitivo do Neurotron.
Versão: 0.1 (Nascimento)
"""
from pathlib import Path
# ======================================
# 🌐 Diretórios e Caminhos
# ======================================
BASE_DIR = Path(__file__).resolve().parents[1] # /opt/kernel/neurotron/
CORE_DIR = BASE_DIR / "neurotron_core"
LOG_DIR = Path("/var/log/neurotron") # pode não existir ainda no rootfs
RUNTIME_DIR = Path("/var/run/neurotron")
MOUNT_POINT = "/var/neurotron"
DISK_CANDIDATES = ["/dev/vda", "/dev/vdb", "/dev/sda", "/dev/hda"]
# ======================================
# ⚙️ Parâmetros Cognitivos Principais
# ======================================
# Tempo entre ciclos cognitivos (em segundos)
NEUROTRON_TICK = 1.0
# Verbosidade dos logs (0 = silêncio, 1 = normal, 2 = debug)
NEUROTRON_VERBOSITY = 1
# Modo de operação
# - diagnostic: executa verificações de integridade
# - learning: ativa ciclos adaptativos (tree, etc.)
# - simulation: executa comportamento contínuo de observação
NEUROTRON_MODE = "diagnostic"
# Limite de homeostase (auto-regulação)
# Se CPU ou memória ultrapassarem este valor (%), o sistema reduz ritmo
NEUROTRON_HOMEOSTASIS = 85.0
HOMEOSTASIS_CPU_WARN = 70.0 # %
HOMEOSTASIS_CPU_ALERT = 85.0 # %
HOMEOSTASIS_MEM_WARN = 75.0 # %
HOMEOSTASIS_MEM_ALERT = 90.0 # %
HOMEOSTASIS_LOAD_WARN = 1.5 # média 1-min (ajuste ao teu core single/SMT)
HOMEOSTASIS_LOAD_ALERT = 3.0
NEUROTRON_DIAG_EVERY_TICKS = 5 # a cada N ciclos cognitivos, reavaliar sinais vitais
NEUROTRON_TICK_MIN = 0.5
NEUROTRON_TICK_MAX = 3.0
NEUROTRON_TICK_STEP = 0.25
# Entropia (seed) para gerar comportamentos pseudoaleatórios
NEUROTRON_SEED = 42
# Tamanho máximo da memória do Hipocampo (em KB)
NEUROTRON_MEMORY_SIZE = 256 # define quando o sistema começa a "esquecer"
# ======================================
# 🧩 Parâmetros de Subsistemas
# ======================================
# Cortex — núcleo de decisão
CORTEX_MAX_THREADS = 1 # threads de raciocínio simultâneo
CORTEX_LOOP_DELAY = 0.1 # tempo entre ciclos internos
# Hippocampus — memória
HIPPOCAMPUS_LOG_RETENTION = 100 # número máximo de logs guardados
HIPPOCAMPUS_AUTOSAVE = True # ativa auto-gravação entre ciclos
# Motor — saída / ação
MOTOR_OUTPUT_DEVICE = "console" # destino: console, log, cloud (futuro)
MOTOR_SHOW_SYMBOLS = True # exibe símbolos (🧠, ⚙️, etc.)
# Perception — sensores
PERCEPTION_CPU_SOURCE = "/proc/stat"
PERCEPTION_MEM_SOURCE = "/proc/meminfo"
PERCEPTION_UPDATE_INTERVAL = 2.0 # segundos entre medições
# ======================================
# 🧠 Parâmetros Futuros (placeholders)
# ======================================
# Modo de expansão (para versões futuras)
# "none", "networked", "distributed"
NEUROTRON_EXPANSION_MODE = "none"
# Caminho do dataset local (para aprendizagem offline)
NEUROTRON_DATASET_PATH = BASE_DIR / "data"
NEUROTRON_HISTORY_KEEP = 8 # manter últimas N entradas no ficheiro
# Identificador de schema para upgrades
NEUROTRON_DIAG_SCHEMA = "v4"
# --- Telemetria e Heartbeat (V5) ---
HEARTBEAT_ENABLED = True # Mostrar batimento a cada tick
HEARTBEAT_STYLE = "compact" # "compact" ou "verbose"
# Limiares de microalertas (homeostase)
NEUROTRON_THRESHOLDS = {
"cpu_high": 85.0, # %
"mem_high": 90.0, # %
"load1_high": 2.0, # load avg(1min)
}
# Buffer de telemetria em memória e flush periódico
TELEMETRY_MAXLEN = 64
TELEMETRY_FLUSH_EVERY_TICKS = 5 # de tempos a tempos, gravar em JSON
# ======================================
# 🧭 Utilitário: impressão de parâmetros
# ======================================
def show_config():
"""Mostra a configuração atual do Neurotron"""
import json
cfg = {k: v for k, v in globals().items() if k.startswith("NEUROTRON_")}
print(json.dumps(cfg, indent=2, default=str))
if __name__ == "__main__":
show_config()

View File

@ -0,0 +1,89 @@
import os
from time import sleep
class Perception:
"""
Sensores internos via /proc:
- CPU % calculado por delta de /proc/stat
- Memória % via /proc/meminfo
- Carga média via /proc/loadavg
Sem dependências externas (psutil).
"""
def _read_proc_stat(self):
try:
with open("/proc/stat", "r") as f:
line = f.readline()
if not line.startswith("cpu "):
return None
parts = line.strip().split()[1:]
vals = list(map(int, parts[:10])) # user nice system idle iowait irq softirq steal guest guest_nice
return {
"user": vals[0], "nice": vals[1], "system": vals[2], "idle": vals[3],
"iowait": vals[4], "irq": vals[5], "softirq": vals[6], "steal": vals[7],
"guest": vals[8], "guest_nice": vals[9],
}
except Exception:
return None
def _cpu_percent(self, interval=0.05):
a = self._read_proc_stat()
if not a:
return "?"
sleep(interval) # micro-janelinha
b = self._read_proc_stat()
if not b:
return "?"
idle_a = a["idle"] + a["iowait"]
idle_b = b["idle"] + b["iowait"]
non_a = sum(a.values()) - idle_a
non_b = sum(b.values()) - idle_b
total_a = idle_a + non_a
total_b = idle_b + non_b
totald = total_b - total_a
idled = idle_b - idle_a
if totald <= 0:
return "?"
usage = (totald - idled) * 100.0 / totald
return round(usage, 1)
def _mem_percent(self):
try:
info = {}
with open("/proc/meminfo", "r") as f:
for line in f:
k, v = line.split(":", 1)
info[k.strip()] = v.strip()
def kB(key):
if key not in info: return None
return float(info[key].split()[0]) # kB
mem_total = kB("MemTotal")
mem_avail = kB("MemAvailable")
if not mem_total or mem_avail is None:
return "?"
used = mem_total - mem_avail
return round(used * 100.0 / mem_total, 1)
except Exception:
return "?"
def _loadavg(self):
try:
if hasattr(os, "getloadavg"):
l1, l5, l15 = os.getloadavg()
return [round(l1, 2), round(l5, 2), round(l15, 2)]
with open("/proc/loadavg", "r") as f:
parts = f.read().strip().split()
l1, l5, l15 = map(float, parts[:3])
return [round(l1, 2), round(l5, 2), round(l15, 2)]
except Exception:
return ["?", "?", "?"]
def snapshot(self) -> dict:
return {
"env_user": os.environ.get("USER") or "root",
"env_term": os.environ.get("TERM") or "unknown",
"cpu_percent": self._cpu_percent(),
"mem_percent": self._mem_percent(),
"loadavg": self._loadavg(),
}

View File

@ -0,0 +1,95 @@
#!/usr/bin/env python3
"""
📊 Painel de Telemetria do Neurotron V0.1
o ficheiro telemetry.json e mostra um mini-ECG digital:
Execução:
python3 /opt/kernel/neurotron/neurotron_core/telemetry_tail.py
"""
import json
import time
import os
from pathlib import Path
from statistics import mean
from rich.console import Console
from rich.table import Table
from rich.panel import Panel
DATASET = "/opt/kernel/neurotron/data/telemetry.json"
BAR_CHARS = "▁▂▃▄▅▆▇█"
SAMPLES = 24 # quantas amostras recentes mostrar
REFRESH = 2.0 # segundos entre atualizações
def mini_graph(values, width=24):
"""Desenha barras simples tipo sparkline"""
if not values:
return "·" * width
vals = [v for v in values if isinstance(v, (int, float))]
if not vals:
return "·" * width
lo, hi = min(vals), max(vals)
span = (hi - lo) or 1.0
bars = []
for v in vals[-width:]:
if not isinstance(v, (int, float)):
bars.append("·")
continue
i = int(round((v - lo) / span * (len(BAR_CHARS) - 1)))
bars.append(BAR_CHARS[i])
return "".join(bars)
def read_telemetry(path: str):
try:
data = json.loads(Path(path).read_text() or "[]")
return data[-SAMPLES:]
except Exception:
return []
def render_panel(console, data):
if not data:
console.print("[yellow]Nenhum dado de telemetria disponível.[/yellow]")
return
cpu = [d.get("cpu") for d in data if isinstance(d.get("cpu"), (int, float))]
mem = [d.get("mem") for d in data if isinstance(d.get("mem"), (int, float))]
load = [d.get("load")[0] for d in data if isinstance(d.get("load"), (list, tuple)) and isinstance(d.get("load")[0], (int, float))]
table = Table(show_header=True, header_style="bold cyan")
table.add_column("Sinal Vital", justify="left")
table.add_column("Tendência", justify="left")
table.add_column("Média", justify="right")
table.add_row("CPU (%)", mini_graph(cpu), f"{mean(cpu):.1f}%" if cpu else "?")
table.add_row("Memória (%)", mini_graph(mem), f"{mean(mem):.1f}%" if mem else "?")
table.add_row("Carga (1min)", mini_graph(load), f"{mean(load):.2f}" if load else "?")
panel = Panel(table, title="🩺 TELEMETRIA RECENTE", border_style="green")
console.clear()
console.print(panel)
def main():
console = Console()
console.print("[bold cyan]Neurotron Telemetry Tail — Iniciar Monitorização[/bold cyan]\n")
while True:
if not Path(DATASET).exists():
console.print(f"[yellow]A aguardar dados em {DATASET}...[/yellow]")
time.sleep(REFRESH)
continue
data = read_telemetry(DATASET)
if not data:
console.print("[yellow]Nenhum dado de telemetria disponível.[/yellow]")
else:
render_panel(console, data)
time.sleep(REFRESH)
if __name__ == "__main__":
main()

View File

@ -0,0 +1,111 @@
#!/usr/bin/env python3
"""
Neurotron ponto de entrada do cérebro do NFDOS.
Boot flow: init (BusyBox) Python Neurotron (este ficheiro).
"""
import os
import sys
import time
import json
from datetime import datetime
from pathlib import Path
from rich.console import Console
from rich.panel import Panel
from rich.table import Table
from rich.pretty import pprint
from neurotron_core import neurotron_config
from neurotron_core.autodiagnostic import AutoDiagnostic
from neurotron_core.perception import Perception
from neurotron_core.neurotron_config import (
NEUROTRON_TICK, NEUROTRON_MODE, NEUROTRON_HOMEOSTASIS,
CORTEX_LOOP_DELAY, MOTOR_OUTPUT_DEVICE, BASE_DIR, CORE_DIR
)
console = Console()
# Caminho base do Neurotron
if not CORE_DIR.exists():
console.print(f"[red]Erro:[/] diretório esperado não encontrado: {CORE_DIR}")
sys.exit(1)
if str(CORE_DIR) not in sys.path:
sys.path.insert(0, str(CORE_DIR))
console.print("[cyan]🧩 Mapa Neural de Importação:[/cyan]")
for p in sys.path:
console.print(f" - {p}")
from neurotron_core.cortex import Cortex # noqa: E402
def detect_persistent_mount() -> bool:
"""Verifica se o hipocampo físico está montado em /var/neurotron"""
mount_point = Path("/var/neurotron")
try:
if mount_point.exists() and os.path.ismount(mount_point):
console.print(f"[green]💾 Hipocampo físico montado:[/] {mount_point}")
return True
else:
# fallback: check by /proc/mounts in early boot
with open("/proc/mounts") as f:
for line in f:
if " /var/neurotron " in line:
console.print(f"[green]💾 Hipocampo físico montado (via /proc):[/] {mount_point}")
return True
except Exception as e:
console.print(f"[yellow]⚠ Falha ao verificar montagem persistente:[/] {e}")
return False
def main():
persistent_mode = detect_persistent_mount()
if persistent_mode:
os.environ["NEUROTRON_MODE"] = "persistent"
os.environ["NEUROTRON_RUNTIME"] = "/var/neurotron/data"
os.environ["NEUROTRON_LOG"] = "/var/neurotron/logs"
else:
os.environ["NEUROTRON_MODE"] = "volatile"
os.environ["NEUROTRON_RUNTIME"] = "/tmp/neurotron_data"
os.environ["NEUROTRON_LOG"] = "/tmp/neurotron_logs"
runtime_dir = Path(os.environ["NEUROTRON_RUNTIME"])
log_dir = Path(os.environ["NEUROTRON_LOG"])
runtime_dir.mkdir(parents=True, exist_ok=True)
log_dir.mkdir(parents=True, exist_ok=True)
mode = os.environ["NEUROTRON_MODE"]
console.print(f"[cyan]🌍 Modo atual do Neurotron:[/] [bold]{mode.upper()}[/]")
# inicializa o Córtex
cortex = Cortex(runtime_dir=runtime_dir, log_dir=log_dir, tick_seconds=NEUROTRON_TICK)
try:
cortex.boot()
state = cortex.diagnostic._load_previous().get("state", "?")
console.print(f"[cyan]🩺 Estado inicial:[/] {state}\n")
console.print("[green]👉 Neurotron inicializado com sucesso.[/]\n")
console.print("[green]✔ [Mensagem Simbolica] Boot OK[/]\n")
console.print("[green]✔ Iniciando ciclo cognitivo.[/]\n")
while True:
cortex.observe()
cortex.think()
cortex.act()
cortex.rest()
except KeyboardInterrupt:
console.print("[yellow]⚠ Interrompido pelo utilizador (SIGINT)[/]")
cortex.shutdown(reason="SIGINT")
except SystemExit:
cortex.shutdown(reason="SystemExit")
except Exception as e:
console.print(f"[red]💥 Exceção não tratada:[/] {e}")
cortex.fatal(e)
if __name__ == "__main__":
main()

29
src/_nfdos/kernel/vga.c Normal file
View File

@ -0,0 +1,29 @@
#include "vga.h"
static size_t row = 0, col = 0;
void vga_clear(uint8_t color) {
for (size_t r = 0; r < VGA_HEIGHT; r++) {
for (size_t c = 0; c < VGA_WIDTH; c++) {
VGA_MEM[r * VGA_WIDTH + c] = vga_entry(' ', color);
}
}
row = col = 0;
}
static void putc(char c, uint8_t color) {
if (c == '\n') {
col = 0;
if (++row >= VGA_HEIGHT) row = 0;
return;
}
VGA_MEM[row * VGA_WIDTH + col] = vga_entry(c, color);
if (++col >= VGA_WIDTH) {
col = 0;
if (++row >= VGA_HEIGHT) row = 0;
}
}
void vga_write_str(const char* s, uint8_t color) {
for (; *s; ++s) putc(*s, color);
}

18
src/_nfdos/kernel/vga.h Normal file
View File

@ -0,0 +1,18 @@
#ifndef VGA_H
#define VGA_H
#include <stdint.h>
#include <stddef.h>
#define VGA_WIDTH 80
#define VGA_HEIGHT 25
#define VGA_MEM ((volatile uint16_t*)0xB8000)
static inline uint16_t vga_entry(char c, uint8_t color) {
return (uint16_t)c | (uint16_t)color << 8;
}
void vga_clear(uint8_t color);
void vga_write_str(const char* s, uint8_t color);
#endif

BIN
src/_nfdos/kernel/vga.o Normal file

Binary file not shown.

View File

@ -0,0 +1,5 @@
{
"rich": {
"version": "latest"
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
src/_nfdos/python Executable file

Binary file not shown.

1
src/_nfdos/rootfs/bin/arch Symbolic link
View File

@ -0,0 +1 @@
busybox

1
src/_nfdos/rootfs/bin/ash Symbolic link
View File

@ -0,0 +1 @@
busybox

View File

@ -0,0 +1 @@
busybox

View File

@ -0,0 +1 @@
busybox

BIN
src/_nfdos/rootfs/bin/busybox Executable file

Binary file not shown.

1
src/_nfdos/rootfs/bin/cat Symbolic link
View File

@ -0,0 +1 @@
busybox

View File

@ -0,0 +1 @@
busybox

1
src/_nfdos/rootfs/bin/chgrp Symbolic link
View File

@ -0,0 +1 @@
busybox

1
src/_nfdos/rootfs/bin/chmod Symbolic link
View File

@ -0,0 +1 @@
busybox

1
src/_nfdos/rootfs/bin/chown Symbolic link
View File

@ -0,0 +1 @@
busybox

View File

@ -0,0 +1 @@
busybox

1
src/_nfdos/rootfs/bin/cp Symbolic link
View File

@ -0,0 +1 @@
busybox

1
src/_nfdos/rootfs/bin/cpio Symbolic link
View File

@ -0,0 +1 @@
busybox

View File

@ -0,0 +1 @@
busybox

1
src/_nfdos/rootfs/bin/date Symbolic link
View File

@ -0,0 +1 @@
busybox

1
src/_nfdos/rootfs/bin/dd Symbolic link
View File

@ -0,0 +1 @@
busybox

1
src/_nfdos/rootfs/bin/df Symbolic link
View File

@ -0,0 +1 @@
busybox

1
src/_nfdos/rootfs/bin/dmesg Symbolic link
View File

@ -0,0 +1 @@
busybox

View File

@ -0,0 +1 @@
busybox

View File

@ -0,0 +1 @@
busybox

1
src/_nfdos/rootfs/bin/echo Symbolic link
View File

@ -0,0 +1 @@
busybox

1
src/_nfdos/rootfs/bin/ed Symbolic link
View File

@ -0,0 +1 @@
busybox

1
src/_nfdos/rootfs/bin/egrep Symbolic link
View File

@ -0,0 +1 @@
busybox

1
src/_nfdos/rootfs/bin/false Symbolic link
View File

@ -0,0 +1 @@
busybox

View File

@ -0,0 +1 @@
busybox

View File

@ -0,0 +1 @@
busybox

1
src/_nfdos/rootfs/bin/fgrep Symbolic link
View File

@ -0,0 +1 @@
busybox

1
src/_nfdos/rootfs/bin/fsync Symbolic link
View File

@ -0,0 +1 @@
busybox

View File

@ -0,0 +1 @@
busybox

1
src/_nfdos/rootfs/bin/grep Symbolic link
View File

@ -0,0 +1 @@
busybox

View File

@ -0,0 +1 @@
busybox

1
src/_nfdos/rootfs/bin/gzip Symbolic link
View File

@ -0,0 +1 @@
busybox

View File

@ -0,0 +1 @@
busybox

1
src/_nfdos/rootfs/bin/hush Symbolic link
View File

@ -0,0 +1 @@
busybox

View File

@ -0,0 +1 @@
busybox

View File

@ -0,0 +1 @@
busybox

View File

@ -0,0 +1 @@
busybox

View File

@ -0,0 +1 @@
busybox

1
src/_nfdos/rootfs/bin/kill Symbolic link
View File

@ -0,0 +1 @@
busybox

1
src/_nfdos/rootfs/bin/link Symbolic link
View File

@ -0,0 +1 @@
busybox

View File

@ -0,0 +1 @@
busybox

View File

@ -0,0 +1 @@
busybox

1
src/_nfdos/rootfs/bin/ln Symbolic link
View File

@ -0,0 +1 @@
busybox

1
src/_nfdos/rootfs/bin/login Symbolic link
View File

@ -0,0 +1 @@
busybox

1
src/_nfdos/rootfs/bin/ls Symbolic link
View File

@ -0,0 +1 @@
busybox

View File

@ -0,0 +1 @@
busybox

1
src/_nfdos/rootfs/bin/lzop Symbolic link
View File

@ -0,0 +1 @@
busybox

Some files were not shown because too many files have changed in this diff Show More