Mi sistema operativo: S-SUN

tenemos un sistema operativo llamado S-SUN esta en gnu-efi alguien puede sugeriri ideas para el sistema , que esten al alcanze de efi

¿Estás hablando de una distribución del sistema operativo GNU con Linux?

1 me gusta

ehhh alguien respondio , bueno es un sistema hecho desde 0 con gnu-efi pero estoy lidiando con este codigo .CODE
PUBLIC PlaySound
PlaySound PROC frequency:DWORD, duration:DWORD

; Configurar temporizador PIT

mov dx, 43h
mov al, 182

out dx, al

; Establecer la frecuencia recibida como par�metro
mov dx, 42h
mov eax, frequency

out dx, eax; Enviar byte bajo
;out dx, al; Enviar byte alto

; speakerman
mov al, 3
mov dx, 61h
out dx, al

; Esperar la duraci�n dada como par�metro
mov ecx, duration

; the loop
DelayLoop:
loop DelayLoop

; bye speakerman
mov al, 0; stop the timer
mov dx, 61h; goodbyte speaker jajajaa
out dx, al; no se

ret
PlaySound ENDP
END en masm x64 el sistema es ErickStudios/S-SUN: s-sun operating system code pero como arreglo este codigo no suena ya tengo un archivo KernelSpeaker.h y un KrnSpeaker.asm /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
File Name:

KernelSpeaker.h

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Abstract:

the speaker file to make sounds
postdata: is broken

--------------------------------------------------------------------------------------------------*/

#ifndef KERNEL_SPEAKER_H
#define KERNEL_SPEAKER_H

#include <efi.h>
#include <efilib.h>

// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// prototypes
// ----------------------------------------------------------------------------------------------

// ----------------------------------------------------------------------------------------------
// constants

#define SPK_IN_ASM 1
#define beep_register 0x300
#define prototype

// ----------------------------------------------------------------------------------------------
// variables

prototype EFI_PCI_IO_PROTOCOL* SoundCardPciIo = NULL;

// ----------------------------------------------------------------------------------------------
// functions

prototype EFI_STATUS
FindSoundCard
(
EFI_SYSTEM_TABLE* SystemTable
);

prototype EFI_STATUS
IsSoundCardReady
(
);
#if !SPK_IN_ASM
prototype EFI_STATUS
PlaySound
(
UINT32 frequency,
UINT32 duration
);
#endif

// ----------------------------------------------------------------------------------------------
// END prototypes
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// functions
// ----------------------------------------------------------------------------------------------

#if SPK_IN_ASM
extern void PlaySound();
#endif

/*
FindSoundCard ( #Kernel_Boot_Function )

Summary:
find a sound card
/
EFI_STATUS
FindSoundCard
(
EFI_SYSTEM_TABLE
SystemTable
)
{
/*
UINTN HandleCount;
EFI_HANDLE* HandleBuffer;
EFI_STATUS Status;

Status = SystemTable->BootServices->LocateHandleBuffer(
    ByProtocol, &gEfiPciIoProtocolGuid, NULL, &HandleCount, &HandleBuffer);
if (EFI_ERROR(Status)) return Status;

for (UINTN i = 0; i < HandleCount; i++) {
    EFI_PCI_IO_PROTOCOL* PciIo;
    Status = SystemTable->BootServices->HandleProtocol(
        HandleBuffer[i], &gEfiPciIoProtocolGuid, (VOID**)&PciIo);
    if (EFI_ERROR(Status)) continue;

    UINT8 ClassCode;
    Status = PciIo->Pci.Read(PciIo, EfiPciIoWidthUint8, 0x0B, 1, &ClassCode);
    if (EFI_ERROR(Status)) continue;

    CHAR16 e[512];

    if (BootStage < 2) {
        SPrint(e, sizeof(e), L"Is ((EFI_PCI_IO_PROTOCOL*) index:i=%d) a Audio Card?", i);
        PrintWithStatus(e, ClassCode == 0x04 ? L"\x2a7" : L"X");
    }

    if (ClassCode == 0x04) {  // 0x04 = Multimedia (Audio)
        SoundCardPciIo = PciIo;
        if (BootStage < 2) {
            PrintWithStatus(L"sound card founded", L"\x2a7");
        }
        UINT32 enableHDA = 1;
        EFI_STATUS Status = SoundCardPciIo->Mem.Write(SoundCardPciIo, EfiPciIoWidthUint32, 0, 0x08, 1, &enableHDA);
        Status = SoundCardPciIo->Mem.Write(SoundCardPciIo, EfiPciIoWidthUint32, 0, 0x08, 1, &enableHDA);
        // AsciiPrint("enabling HDA Intel 0x08: %r\n", Status);

        UINT32 GCTL;
        SoundCardPciIo->Mem.Read(SoundCardPciIo, EfiPciIoWidthUint32, 0, 0x08, 1, &GCTL);

        CHAR16 e[10];

        SPrint(e, sizeof(e), L"%x", GCTL);

        PrintWithStatus(L"Global Control after the activation", e);

        Status = SoundCardPciIo->Mem.Write(SoundCardPciIo, EfiPciIoWidthUint32, 0, 0x20, 1, &enableHDA);
        SoundCardPciIo->Mem.Read(SoundCardPciIo, EfiPciIoWidthUint32, 0, 0x20, 1, &GCTL);

        SPrint(e, sizeof(e), L"%x", GCTL);
        PrintWithStatus(L"register 0x20 after the modification", e);

        Status = SoundCardPciIo->Mem.Write(SoundCardPciIo, EfiPciIoWidthUint32, 0, beep_register, 0, &enableHDA);

        return EFI_SUCCESS;
    }
}

if (BootStage < 2) {
    PrintWithStatus(L"sound card founded", L"X");
}

return EFI_NOT_FOUND;
*/

}

#if !SPK_IN_ASM
/*
IsSoundCardReady

Summary:
check if the card is ready
/
EFI_STATUS
IsSoundCardReady
(
)
{
/

if (!SoundCardPciIo) return EFI_NOT_FOUND;

UINT64 supportedMemRegions;
EFI_STATUS Status = SoundCardPciIo->GetBarAttributes(SoundCardPciIo, 0, NULL, &supportedMemRegions);
if (_DEBUG) {
    CHAR16 e[512];
    SPrint(e, sizeof(e), L"Audio card is ready: %r\n", Status);
    printc(e);
}

// UINT32 GCTL;
// Status = SoundCardPciIo->Mem.Read(SoundCardPciIo, EfiPciIoWidthUint32, 0, 0x08, 1, &GCTL);
// AsciiPrint("Global Control Register (GCTL): %x\n", GCTL);

UINT32 GCTL, State;
SoundCardPciIo->Mem.Read(SoundCardPciIo, EfiPciIoWidthUint32, 0, 0x08, 1, &GCTL);
AsciiPrint("GCTL después de activación: %x\n", GCTL);

SoundCardPciIo->Mem.Read(SoundCardPciIo, EfiPciIoWidthUint32, 0, beep_register, 1, &State);
AsciiPrint("Estado del registro de beep: %x\n", State);

UINT32 codecStatus;
SoundCardPciIo->Mem.Read(SoundCardPciIo, EfiPciIoWidthUint32, 0, 0x20, 1, &codecStatus);
AsciiPrint("Estado del codec de sonido: %x\n", codecStatus);
return Status;
*/

}

/*
PlaySound

Summary:
play a beep
/
EFI_STATUS
PlaySound
(
UINT32 frequency,
UINT32 duration
)
{
/

EFI_SYSTEM_TABLE* SystemTable = gST;

if (!SoundCardPciIo) {
    if (_DEBUG) {
        printc(L"No sound card initialized. Searching...\n");
    }
    EFI_STATUS Status = FindSoundCard(SystemTable);
    if (EFI_ERROR(Status)) return Status;
}

if (_DEBUG) {
    CHAR16 e[512];
    SPrint(e, sizeof(e), L"frequency: %x , duration %x\n", frequency, duration);
    printc(e);
}

// Verificar si la tarjeta está lista
EFI_STATUS Status = IsSoundCardReady();
if (EFI_ERROR(Status)) return Status;

UINT8 BarIndex = 0;

// Configurar volumen
UINT32 volume = 0xFFFF;
// Status = SoundCardPciIo->Mem.Write(SoundCardPciIo, EfiPciIoWidthUint32, BarIndex, 0x80, 1, &volume);
if (_DEBUG) {
    CHAR16 e[512];
    SPrint(e, sizeof(e), L"Writing volume: %r\n", Status);
    printc(e);
}

UINT32 beepFrequency = frequency;  // Frecuencia del tono (prueba con otro valor)
Status = SoundCardPciIo->Mem.Write(SoundCardPciIo, EfiPciIoWidthUint32, BarIndex, beep_register, 1, &frequency);
AsciiPrint("Beep activado: %r\n", Status);

UINT32 GCTL, State;

while (State != frequency) {
    Status = SoundCardPciIo->Mem.Write(SoundCardPciIo, EfiPciIoWidthUint32, BarIndex, beep_register, 1, &frequency);

    SoundCardPciIo->Mem.Read(SoundCardPciIo, EfiPciIoWidthUint32, 0, beep_register, 1, &State);
    AsciiPrint("Estado del registro de beep: %d\n", State);
}

// Esperar la duración del sonido
globalsystemtable->BootServices->Stall(duration * 1000);

// Apagar sonido
UINT32 muteBeep = 0x0000;
Status = SoundCardPciIo->Mem.Write(SoundCardPciIo, EfiPciIoWidthUint32, BarIndex, beep_register, 1, &muteBeep);
AsciiPrint("Beep desactivado: %r\n", Status);

return EFI_SUCCESS;
*/

}
#endif

// ----------------------------------------------------------------------------------------------
// END functions
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#endif no se escucha ningun pitido

¡Aló!

Te recomendaría que usaras la marca de código (```) para hacer el código mas legible en el post, se hace de este modo:

```
Código
```

Y sobre el sistema (simplemente juzgando por la portada por ahora), se vé bien, últimamente estuve trasteando con EFI boot stub por lo que intentar cargarlo no debe ser un gran problema.

Yo no sé ensamblador por ahora, y en el foro esto es prácticamente algo nuevo, por lo que no puedo juzgar desde el código, solo desde la práctica. :confused:

como que lo probaste? bueno ya alguien lo probo por que nadie lo probaba, cual portada, al final lo pudiste cargar bien?

pronto voy a lanzar una actualizacion que traducira algunas cosas, algunas optimizaciones y eliminaciones de funciones que no se usaban y otras cosas , cuando ponga este comentario ya habre lanzado la actualizacion o compilado el codigo uefi , pueden ayudarme con las traducciones , lo pueden descargar y probar en qemu (recomendablemente en qemu) con OVMF.fd y si tienen problemas buscando el ovmf.fd tambien pueden probarlo en su PC , claro , para eso tienen que ponerlo en un pendrive en la carpeta /efi/boot, desactivar el security boot y arrancar desde el pendrive, S-SUN se carga 100% en memoria y no afectara el sistema (windows o linux) ErickCraftStudios - S-SUN para la pagina o boot - OneDrive para la descarga directa

alguna vez alguien ah presionado en una confirmacion cualquier tecla que no sea Y o N pues auqneu en otros sistemas sale un error en S-SUN tenemos este codigo para eso

bool_t
YNConfirmation
(
    CHAR16* ConfirmationMsg
)
{
    bool_t theUserIsXd = 1;
    bool_t returned = 0;

    u8 angry_level = 0;

    while (theUserIsXd)
    {
        EFI_INPUT_KEY Key;


        SetScreenAtribute(0, brblue);
        if (
            angry_level > 5
            ) {
            SetScreenAtribute(0, red);
        }

        if (
            angry_level > 6
            ) {
            SetScreenAtribute(0, darkred);
            printc(L"AHHHHHHHHH");
            gBS->Stall(100000);

            ShowPanic(UNKNOW_ERROR);

            while (true);
        }

        if (
            angry_level > 5
            ) {
            printc(L"YOU , CHILDREN OF YOUR MOM , I SAYING YOU ");
        }
        printc(ConfirmationMsg);

        if (
            angry_level > 3
            ) {
            printc(L"!");
        }
        if (
            angry_level > 5
            ) {
            printc(L"!!!");
        }

        SetScreenAtribute(0, brcyan);

        printc(L"Y/N ");
        SetScreenAtribute(0, brgreen);
        gBS->WaitForEvent(1, &gST->ConIn->WaitForKey, 1);

        gST->ConIn->ReadKeyStroke(gST->ConIn, &Key);

        CHAR16 OK[2];

        OK[0] = Key.UnicodeChar;

        OK[1] = 0;

        printc(OK);

        theUserIsXd = 0;
        if (
            Key.UnicodeChar == L'y' || Key.UnicodeChar == L'Y' ||
            Key.UnicodeChar == L'n' || Key.UnicodeChar == L'N' ||
            Key.UnicodeChar == CHAR_CARRIAGE_RETURN || Key.ScanCode == SCAN_ESC
            )
        {
            if (
                Key.UnicodeChar == L'y' || Key.UnicodeChar == L'Y' || Key.UnicodeChar == CHAR_CARRIAGE_RETURN
                )
            {
                returned = 1;
            }
            else {
                returned = 0;
            }
            printc(L"\n");
        }
        else {
            theUserIsXd = 1;
            angry_level++;
            printc(L"\n");
        }
    }
}

si , el sistema se enoja , muy orignal creo

Ese enlace que compartiste envía a un sitio web que espía, maltrata y viola la privacidad e intimidad de quienes la visitan.

1 me gusta

solo se que ahi subi el archivo del sistema para que se pueda descargar por que no se crear links de descarga

ahhh por la telemetria del sitio de OneDrive? entonces donde publico el archivo

pero que hace OneDrive? o por que viola la privacidad de los usuarios si solo es un link de descarga o es lo que yo se por que yo subi el archivo y ese archivo yo mismo lo compile con visual studio

ahi si quieres saber que hace el .efi aqui esta el codigo fuente ErickStudios/S-SUN: s-sun operating system code