text
stringlengths 2
104M
| meta
dict |
---|---|
#ifndef _EFI_CONFORK_H
#define _EFI_CONFORK_H
/*++
Copyright (c) 1999 Intel Corporation
Module Name:
Abstract:
Revision History
--*/
//
// ConOut Forker Protocol
//
#define TEXT_OUT_SPLITER_PROTOCOL \
{ 0x56d830a0, 0x7e7a, 0x11d3, {0xbb, 0xa0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
#define ERROR_OUT_SPLITER_PROTOCOL \
{ 0xf0ba9039, 0x68f1, 0x425e, {0xaa, 0x7f, 0xd9, 0xaa, 0xf9, 0x1b, 0x82, 0xa1}}
#define TEXT_IN_SPLITER_PROTOCOL \
{ 0xf9a3c550, 0x7fb5, 0x11d3, {0xbb, 0xa0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
#endif
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
#
#
#
[sources]
efivar.h
legacyboot.h
VgaClass.h
intload.h
[ia32sources]
[ia64sources]
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
#
# This is a machine generated file - DO NOT EDIT
# Generated by genmake.exe
# Generated from make.inf
# Copyright (c) 1998 Intel Corporation
#
INC_DEPS = $(INC_DEPS) \
$(SDK_INSTALL_DIR)\include\efi\protocol\efivar.h \
$(SDK_INSTALL_DIR)\include\efi\protocol\legacyboot.h \
$(SDK_INSTALL_DIR)\include\efi\protocol\vgaclass.h \
$(SDK_INSTALL_DIR)\include\efi\protocol\efidbg.h \
!IF "$(PROCESSOR)" == "Ia32"
INC_DEPS = $(INC_DEPS) \
!ENDIF
!IF "$(PROCESSOR)" == "Ia64"
INC_DEPS = $(INC_DEPS) \
$(SDK_INSTALL_DIR)\include\efi\protocol\$(PROCESSOR)\eficontext.h \
!ENDIF
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
/*
* Copyright (c) 1999, 2000
* Intel Corporation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
*
* This product includes software developed by Intel Corporation and
* its contributors.
*
* 4. Neither the name of Intel Corporation or its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION AND CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef _EFICONTEXT_H_
#define _EFICONTEXT_H_
//
// IA-64 processor exception types
//
#define EXCPT_ALT_DTLB 4
#define EXCPT_DNESTED_TLB 5
#define EXCPT_BREAKPOINT 11
#define EXCPT_EXTERNAL_INTERRUPT 12
#define EXCPT_GEN_EXCEPT 24
#define EXCPT_NAT_CONSUMPTION 26
#define EXCPT_DEBUG_EXCEPT 29
#define EXCPT_UNALIGNED_ACCESS 30
#define EXCPT_FP_FAULT 32
#define EXCPT_FP_TRAP 33
#define EXCPT_TAKEN_BRANCH 35
#define EXCPT_SINGLE_STEP 36
//
// IA-64 processor context definition - must be 512 byte aligned!!!
//
typedef
struct {
UINT64 reserved; // necessary to preserve alignment for the correct bits in UNAT and to insure F2 is 16 byte aligned...
UINT64 r1;
UINT64 r2;
UINT64 r3;
UINT64 r4;
UINT64 r5;
UINT64 r6;
UINT64 r7;
UINT64 r8;
UINT64 r9;
UINT64 r10;
UINT64 r11;
UINT64 r12;
UINT64 r13;
UINT64 r14;
UINT64 r15;
UINT64 r16;
UINT64 r17;
UINT64 r18;
UINT64 r19;
UINT64 r20;
UINT64 r21;
UINT64 r22;
UINT64 r23;
UINT64 r24;
UINT64 r25;
UINT64 r26;
UINT64 r27;
UINT64 r28;
UINT64 r29;
UINT64 r30;
UINT64 r31;
UINT64 f2[2];
UINT64 f3[2];
UINT64 f4[2];
UINT64 f5[2];
UINT64 f6[2];
UINT64 f7[2];
UINT64 f8[2];
UINT64 f9[2];
UINT64 f10[2];
UINT64 f11[2];
UINT64 f12[2];
UINT64 f13[2];
UINT64 f14[2];
UINT64 f15[2];
UINT64 f16[2];
UINT64 f17[2];
UINT64 f18[2];
UINT64 f19[2];
UINT64 f20[2];
UINT64 f21[2];
UINT64 f22[2];
UINT64 f23[2];
UINT64 f24[2];
UINT64 f25[2];
UINT64 f26[2];
UINT64 f27[2];
UINT64 f28[2];
UINT64 f29[2];
UINT64 f30[2];
UINT64 f31[2];
UINT64 pr;
UINT64 b0;
UINT64 b1;
UINT64 b2;
UINT64 b3;
UINT64 b4;
UINT64 b5;
UINT64 b6;
UINT64 b7;
// application registers
UINT64 ar_rsc;
UINT64 ar_bsp;
UINT64 ar_bspstore;
UINT64 ar_rnat;
UINT64 ar_fcr;
UINT64 ar_eflag;
UINT64 ar_csd;
UINT64 ar_ssd;
UINT64 ar_cflg;
UINT64 ar_fsr;
UINT64 ar_fir;
UINT64 ar_fdr;
UINT64 ar_ccv;
UINT64 ar_unat;
UINT64 ar_fpsr;
UINT64 ar_pfs;
UINT64 ar_lc;
UINT64 ar_ec;
// control registers
UINT64 cr_dcr;
UINT64 cr_itm;
UINT64 cr_iva;
UINT64 cr_pta;
UINT64 cr_ipsr;
UINT64 cr_isr;
UINT64 cr_iip;
UINT64 cr_ifa;
UINT64 cr_itir;
UINT64 cr_iipa;
UINT64 cr_ifs;
UINT64 cr_iim;
UINT64 cr_iha;
// debug registers
UINT64 dbr0;
UINT64 dbr1;
UINT64 dbr2;
UINT64 dbr3;
UINT64 dbr4;
UINT64 dbr5;
UINT64 dbr6;
UINT64 dbr7;
UINT64 ibr0;
UINT64 ibr1;
UINT64 ibr2;
UINT64 ibr3;
UINT64 ibr4;
UINT64 ibr5;
UINT64 ibr6;
UINT64 ibr7;
// virtual registers
UINT64 int_nat; // nat bits for R1-R31
} SYSTEM_CONTEXT;
#endif /* _EFI_CONTEXT_H_ */
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
/*++
Copyright (c) 1998 Intel Corporation
Module Name:
efilibplat.h
Abstract:
EFI to compile bindings
Revision History
--*/
VOID
InitializeLibPlatform (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
);
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
/*
* Copright (C) 2014 - 2015 Linaro Ltd.
* Author: Ard Biesheuvel <[email protected]>
* Copright (C) 2017 Lemote Co.
* Author: Heiher <[email protected]>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice and this list of conditions, without modification.
* 2. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* Alternatively, this software may be distributed 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.
*/
#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L ) && !defined(__cplusplus)
// ANSI C 1999/2000 stdint.h integer width declarations
typedef unsigned long uint64_t;
typedef long int64_t;
typedef unsigned int uint32_t;
typedef int int32_t;
typedef unsigned short uint16_t;
typedef short int16_t;
typedef unsigned char uint8_t;
typedef signed char int8_t; // unqualified 'char' is unsigned on ARM
typedef uint64_t uintptr_t;
typedef int64_t intptr_t;
#else
#include <stdint.h>
#endif
//
// Basic EFI types of various widths
//
#ifndef __WCHAR_TYPE__
# define __WCHAR_TYPE__ short
#endif
typedef uint64_t UINT64;
typedef int64_t INT64;
typedef uint32_t UINT32;
typedef int32_t INT32;
typedef uint16_t UINT16;
typedef int16_t INT16;
typedef uint8_t UINT8;
typedef int8_t INT8;
typedef __WCHAR_TYPE__ WCHAR;
#undef VOID
#define VOID void
typedef int64_t INTN;
typedef uint64_t UINTN;
#define EFIERR(a) (0x8000000000000000 | a)
#define EFI_ERROR_MASK 0x8000000000000000
#define EFIERR_OEM(a) (0xc000000000000000 | a)
#define BAD_POINTER 0xFBFBFBFBFBFBFBFB
#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFF
#define BREAKPOINT() while (TRUE); // Make it hang on Bios[Dbg]32
//
// Pointers must be aligned to these address to function
//
#define MIN_ALIGNMENT_SIZE 8
#define ALIGN_VARIABLE(Value ,Adjustment) \
(UINTN)Adjustment = 0; \
if((UINTN)Value % MIN_ALIGNMENT_SIZE) \
(UINTN)Adjustment = MIN_ALIGNMENT_SIZE - ((UINTN)Value % MIN_ALIGNMENT_SIZE); \
Value = (UINTN)Value + (UINTN)Adjustment
//
// Define macros to build data structure signatures from characters.
//
#define EFI_SIGNATURE_16(A,B) ((A) | (B<<8))
#define EFI_SIGNATURE_32(A,B,C,D) (EFI_SIGNATURE_16(A,B) | (EFI_SIGNATURE_16(C,D) << 16))
#define EFI_SIGNATURE_64(A,B,C,D,E,F,G,H) (EFI_SIGNATURE_32(A,B,C,D) | ((UINT64)(EFI_SIGNATURE_32(E,F,G,H)) << 32))
//
// EFIAPI - prototype calling convention for EFI function pointers
// BOOTSERVICE - prototype for implementation of a boot service interface
// RUNTIMESERVICE - prototype for implementation of a runtime service interface
// RUNTIMEFUNCTION - prototype for implementation of a runtime function that is not a service
// RUNTIME_CODE - pragma macro for declaring runtime code
//
#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options
#define EFIAPI // Substitute expresion to force C calling convention
#endif
#define BOOTSERVICE
#define RUNTIMESERVICE
#define RUNTIMEFUNCTION
#define RUNTIME_CODE(a) alloc_text("rtcode", a)
#define BEGIN_RUNTIME_DATA() data_seg("rtdata")
#define END_RUNTIME_DATA() data_seg("")
#define VOLATILE volatile
#define MEMORY_FENCE __sync_synchronize
//
// When build similiar to FW, then link everything together as
// one big module.
//
#define EFI_DRIVER_ENTRY_POINT(InitFunction) \
UINTN \
InitializeDriver ( \
VOID *ImageHandle, \
VOID *SystemTable \
) \
{ \
return InitFunction(ImageHandle, \
SystemTable); \
} \
\
EFI_STATUS efi_main( \
EFI_HANDLE image, \
EFI_SYSTEM_TABLE *systab \
) __attribute__((weak, \
alias ("InitializeDriver")));
#define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \
(_if)->LoadInternal(type, name, entry)
//
// Some compilers don't support the forward reference construct:
// typedef struct XXXXX
//
// The following macro provide a workaround for such cases.
#define INTERFACE_DECL(x) struct x
#define uefi_call_wrapper(func, va_num, ...) func(__VA_ARGS__)
#define EFI_FUNCTION
static inline UINT64 swap_uint64 (UINT64 v)
{
asm volatile (
"dsbh %[v], %[v] \n\t"
"dshd %[v], %[v] \n\t"
:[v]"+r"(v)
);
return v;
}
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
#ifndef GNU_EFI_MIPS64EL_SETJMP_H
#define GNU_EFI_MIPS64EL_SETJMP_H
#define JMPBUF_ALIGN 8
typedef struct {
/* GP regs */
UINT64 RA;
UINT64 SP;
UINT64 FP;
UINT64 GP;
UINT64 S0;
UINT64 S1;
UINT64 S2;
UINT64 S3;
UINT64 S4;
UINT64 S5;
UINT64 S6;
UINT64 S7;
#ifdef __mips_hard_float
/* FP regs */
UINT64 F24;
UINT64 F25;
UINT64 F26;
UINT64 F27;
UINT64 F28;
UINT64 F29;
UINT64 F30;
UINT64 F31;
#endif
} ALIGN(JMPBUF_ALIGN) jmp_buf[1];
#endif /* GNU_EFI_MIPS64EL_SETJMP_H */
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
/*++
Copyright (c) 1998 Intel Corporation
Module Name:
efilibplat.h
Abstract:
EFI to compile bindings
Revision History
--*/
VOID
InitializeLibPlatform (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
);
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
/*
PE32+ header file
*/
#ifndef _PE_H
#define _PE_H
#define IMAGE_DOS_SIGNATURE 0x5A4D // MZ
#define IMAGE_OS2_SIGNATURE 0x454E // NE
#define IMAGE_OS2_SIGNATURE_LE 0x454C // LE
#define IMAGE_NT_SIGNATURE 0x00004550 // PE00
#define IMAGE_EDOS_SIGNATURE 0x44454550 // PEED
typedef struct _IMAGE_DOS_HEADER { // DOS .EXE header
UINT16 e_magic; // Magic number
UINT16 e_cblp; // Bytes on last page of file
UINT16 e_cp; // Pages in file
UINT16 e_crlc; // Relocations
UINT16 e_cparhdr; // Size of header in paragraphs
UINT16 e_minalloc; // Minimum extra paragraphs needed
UINT16 e_maxalloc; // Maximum extra paragraphs needed
UINT16 e_ss; // Initial (relative) SS value
UINT16 e_sp; // Initial SP value
UINT16 e_csum; // Checksum
UINT16 e_ip; // Initial IP value
UINT16 e_cs; // Initial (relative) CS value
UINT16 e_lfarlc; // File address of relocation table
UINT16 e_ovno; // Overlay number
UINT16 e_res[4]; // Reserved words
UINT16 e_oemid; // OEM identifier (for e_oeminfo)
UINT16 e_oeminfo; // OEM information; e_oemid specific
UINT16 e_res2[10]; // Reserved words
UINT32 e_lfanew; // File address of new exe header
} IMAGE_DOS_HEADER, *PIMAGE_DOS_HEADER;
typedef struct _IMAGE_OS2_HEADER { // OS/2 .EXE header
UINT16 ne_magic; // Magic number
UINT8 ne_ver; // Version number
UINT8 ne_rev; // Revision number
UINT16 ne_enttab; // Offset of Entry Table
UINT16 ne_cbenttab; // Number of bytes in Entry Table
UINT32 ne_crc; // Checksum of whole file
UINT16 ne_flags; // Flag UINT16
UINT16 ne_autodata; // Automatic data segment number
UINT16 ne_heap; // Initial heap allocation
UINT16 ne_stack; // Initial stack allocation
UINT32 ne_csip; // Initial CS:IP setting
UINT32 ne_sssp; // Initial SS:SP setting
UINT16 ne_cseg; // Count of file segments
UINT16 ne_cmod; // Entries in Module Reference Table
UINT16 ne_cbnrestab; // Size of non-resident name table
UINT16 ne_segtab; // Offset of Segment Table
UINT16 ne_rsrctab; // Offset of Resource Table
UINT16 ne_restab; // Offset of resident name table
UINT16 ne_modtab; // Offset of Module Reference Table
UINT16 ne_imptab; // Offset of Imported Names Table
UINT32 ne_nrestab; // Offset of Non-resident Names Table
UINT16 ne_cmovent; // Count of movable entries
UINT16 ne_align; // Segment alignment shift count
UINT16 ne_cres; // Count of resource segments
UINT8 ne_exetyp; // Target Operating system
UINT8 ne_flagsothers; // Other .EXE flags
UINT16 ne_pretthunks; // offset to return thunks
UINT16 ne_psegrefbytes; // offset to segment ref. bytes
UINT16 ne_swaparea; // Minimum code swap area size
UINT16 ne_expver; // Expected Windows version number
} IMAGE_OS2_HEADER, *PIMAGE_OS2_HEADER;
//
// File header format.
//
typedef struct _IMAGE_FILE_HEADER {
UINT16 Machine;
UINT16 NumberOfSections;
UINT32 TimeDateStamp;
UINT32 PointerToSymbolTable;
UINT32 NumberOfSymbols;
UINT16 SizeOfOptionalHeader;
UINT16 Characteristics;
} IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER;
#define IMAGE_SIZEOF_FILE_HEADER 20
#define IMAGE_FILE_RELOCS_STRIPPED 0x0001 // Relocation info stripped from file.
#define IMAGE_FILE_EXECUTABLE_IMAGE 0x0002 // File is executable (i.e. no unresolved externel references).
#define IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004 // Line nunbers stripped from file.
#define IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008 // Local symbols stripped from file.
#define IMAGE_FILE_BYTES_REVERSED_LO 0x0080 // Bytes of machine word are reversed.
#define IMAGE_FILE_32BIT_MACHINE 0x0100 // 32 bit word machine.
#define IMAGE_FILE_DEBUG_STRIPPED 0x0200 // Debugging info stripped from file in .DBG file
#define IMAGE_FILE_SYSTEM 0x1000 // System File.
#define IMAGE_FILE_DLL 0x2000 // File is a DLL.
#define IMAGE_FILE_BYTES_REVERSED_HI 0x8000 // Bytes of machine word are reversed.
#define IMAGE_FILE_MACHINE_UNKNOWN 0
#define IMAGE_FILE_MACHINE_I386 0x14c // Intel 386.
#define IMAGE_FILE_MACHINE_R3000 0x162 // MIPS little-endian, 0540 big-endian
#define IMAGE_FILE_MACHINE_R4000 0x166 // MIPS little-endian
#define IMAGE_FILE_MACHINE_ALPHA 0x184 // Alpha_AXP
#define IMAGE_FILE_MACHINE_ARMTHUMB_MIXED 0x1c2 // Arm/Thumb
#define IMAGE_FILE_MACHINE_POWERPC 0x1F0 // IBM PowerPC Little-Endian
#define IMAGE_FILE_MACHINE_IA64 0x200 // IA-64
#define IMAGE_FILE_MACHINE_TAHOE 0x7cc // Intel EM machine
#define IMAGE_FILE_MACHINE_EBC 0xebc // EFI Byte Code
#define IMAGE_FILE_MACHINE_X64 0x8664 // x86_64
//
// Directory format.
//
typedef struct _IMAGE_DATA_DIRECTORY {
UINT32 VirtualAddress;
UINT32 Size;
} IMAGE_DATA_DIRECTORY, *PIMAGE_DATA_DIRECTORY;
#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16
//
// Optional header format.
//
typedef struct _IMAGE_OPTIONAL_HEADER {
//
// Standard fields.
//
UINT16 Magic;
UINT8 MajorLinkerVersion;
UINT8 MinorLinkerVersion;
UINT32 SizeOfCode;
UINT32 SizeOfInitializedData;
UINT32 SizeOfUninitializedData;
UINT32 AddressOfEntryPoint;
UINT32 BaseOfCode;
UINT32 BaseOfData;
//
// NT additional fields.
//
UINT32 ImageBase;
UINT32 SectionAlignment;
UINT32 FileAlignment;
UINT16 MajorOperatingSystemVersion;
UINT16 MinorOperatingSystemVersion;
UINT16 MajorImageVersion;
UINT16 MinorImageVersion;
UINT16 MajorSubsystemVersion;
UINT16 MinorSubsystemVersion;
UINT32 Reserved1;
UINT32 SizeOfImage;
UINT32 SizeOfHeaders;
UINT32 CheckSum;
UINT16 Subsystem;
UINT16 DllCharacteristics;
UINT32 SizeOfStackReserve;
UINT32 SizeOfStackCommit;
UINT32 SizeOfHeapReserve;
UINT32 SizeOfHeapCommit;
UINT32 LoaderFlags;
UINT32 NumberOfRvaAndSizes;
IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES];
} IMAGE_OPTIONAL_HEADER, *PIMAGE_OPTIONAL_HEADER;
typedef struct _IMAGE_ROM_OPTIONAL_HEADER {
UINT16 Magic;
UINT8 MajorLinkerVersion;
UINT8 MinorLinkerVersion;
UINT32 SizeOfCode;
UINT32 SizeOfInitializedData;
UINT32 SizeOfUninitializedData;
UINT32 AddressOfEntryPoint;
UINT32 BaseOfCode;
UINT32 BaseOfData;
UINT32 BaseOfBss;
UINT32 GprMask;
UINT32 CprMask[4];
UINT32 GpValue;
} IMAGE_ROM_OPTIONAL_HEADER, *PIMAGE_ROM_OPTIONAL_HEADER;
#define IMAGE_SIZEOF_ROM_OPTIONAL_HEADER 56
#define IMAGE_SIZEOF_STD_OPTIONAL_HEADER 28
#define IMAGE_SIZEOF_NT_OPTIONAL_HEADER 224
#define IMAGE_NT_OPTIONAL_HDR_MAGIC 0x10b
#define IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107
typedef struct _IMAGE_NT_HEADERS {
UINT32 Signature;
IMAGE_FILE_HEADER FileHeader;
IMAGE_OPTIONAL_HEADER OptionalHeader;
} IMAGE_NT_HEADERS, *PIMAGE_NT_HEADERS;
typedef struct _IMAGE_ROM_HEADERS {
IMAGE_FILE_HEADER FileHeader;
IMAGE_ROM_OPTIONAL_HEADER OptionalHeader;
} IMAGE_ROM_HEADERS, *PIMAGE_ROM_HEADERS;
#define IMAGE_FIRST_SECTION( ntheader ) ((PIMAGE_SECTION_HEADER) \
((UINT32)ntheader + \
FIELD_OFFSET( IMAGE_NT_HEADERS, OptionalHeader ) + \
((PIMAGE_NT_HEADERS)(ntheader))->FileHeader.SizeOfOptionalHeader \
))
// Subsystem Values
#define IMAGE_SUBSYSTEM_UNKNOWN 0 // Unknown subsystem.
#define IMAGE_SUBSYSTEM_NATIVE 1 // Image doesn't require a subsystem.
#define IMAGE_SUBSYSTEM_WINDOWS_GUI 2 // Image runs in the Windows GUI subsystem.
#define IMAGE_SUBSYSTEM_WINDOWS_CUI 3 // Image runs in the Windows character subsystem.
#define IMAGE_SUBSYSTEM_OS2_CUI 5 // image runs in the OS/2 character subsystem.
#define IMAGE_SUBSYSTEM_POSIX_CUI 7 // image run in the Posix character subsystem.
// Directory Entries
#define IMAGE_DIRECTORY_ENTRY_EXPORT 0 // Export Directory
#define IMAGE_DIRECTORY_ENTRY_IMPORT 1 // Import Directory
#define IMAGE_DIRECTORY_ENTRY_RESOURCE 2 // Resource Directory
#define IMAGE_DIRECTORY_ENTRY_EXCEPTION 3 // Exception Directory
#define IMAGE_DIRECTORY_ENTRY_SECURITY 4 // Security Directory
#define IMAGE_DIRECTORY_ENTRY_BASERELOC 5 // Base Relocation Table
#define IMAGE_DIRECTORY_ENTRY_DEBUG 6 // Debug Directory
#define IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7 // Description String
#define IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8 // Machine Value (MIPS GP)
#define IMAGE_DIRECTORY_ENTRY_TLS 9 // TLS Directory
#define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10 // Load Configuration Directory
//
// Section header format.
//
#define IMAGE_SIZEOF_SHORT_NAME 8
typedef struct _IMAGE_SECTION_HEADER {
UINT8 Name[IMAGE_SIZEOF_SHORT_NAME];
union {
UINT32 PhysicalAddress;
UINT32 VirtualSize;
} Misc;
UINT32 VirtualAddress;
UINT32 SizeOfRawData;
UINT32 PointerToRawData;
UINT32 PointerToRelocations;
UINT32 PointerToLinenumbers;
UINT16 NumberOfRelocations;
UINT16 NumberOfLinenumbers;
UINT32 Characteristics;
} IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER;
#define IMAGE_SIZEOF_SECTION_HEADER 40
#define IMAGE_SCN_TYPE_NO_PAD 0x00000008 // Reserved.
#define IMAGE_SCN_CNT_CODE 0x00000020 // Section contains code.
#define IMAGE_SCN_CNT_INITIALIZED_DATA 0x00000040 // Section contains initialized data.
#define IMAGE_SCN_CNT_UNINITIALIZED_DATA 0x00000080 // Section contains uninitialized data.
#define IMAGE_SCN_LNK_OTHER 0x00000100 // Reserved.
#define IMAGE_SCN_LNK_INFO 0x00000200 // Section contains comments or some other type of information.
#define IMAGE_SCN_LNK_REMOVE 0x00000800 // Section contents will not become part of image.
#define IMAGE_SCN_LNK_COMDAT 0x00001000 // Section contents comdat.
#define IMAGE_SCN_ALIGN_1BYTES 0x00100000 //
#define IMAGE_SCN_ALIGN_2BYTES 0x00200000 //
#define IMAGE_SCN_ALIGN_4BYTES 0x00300000 //
#define IMAGE_SCN_ALIGN_8BYTES 0x00400000 //
#define IMAGE_SCN_ALIGN_16BYTES 0x00500000 // Default alignment if no others are specified.
#define IMAGE_SCN_ALIGN_32BYTES 0x00600000 //
#define IMAGE_SCN_ALIGN_64BYTES 0x00700000 //
#define IMAGE_SCN_MEM_DISCARDABLE 0x02000000 // Section can be discarded.
#define IMAGE_SCN_MEM_NOT_CACHED 0x04000000 // Section is not cachable.
#define IMAGE_SCN_MEM_NOT_PAGED 0x08000000 // Section is not pageable.
#define IMAGE_SCN_MEM_SHARED 0x10000000 // Section is shareable.
#define IMAGE_SCN_MEM_EXECUTE 0x20000000 // Section is executable.
#define IMAGE_SCN_MEM_READ 0x40000000 // Section is readable.
#define IMAGE_SCN_MEM_WRITE 0x80000000 // Section is writeable.
//
// Symbol format.
//
#define IMAGE_SIZEOF_SYMBOL 18
//
// Section values.
//
// Symbols have a section number of the section in which they are
// defined. Otherwise, section numbers have the following meanings:
//
#define IMAGE_SYM_UNDEFINED (UINT16)0 // Symbol is undefined or is common.
#define IMAGE_SYM_ABSOLUTE (UINT16)-1 // Symbol is an absolute value.
#define IMAGE_SYM_DEBUG (UINT16)-2 // Symbol is a special debug item.
//
// Type (fundamental) values.
//
#define IMAGE_SYM_TYPE_NULL 0 // no type.
#define IMAGE_SYM_TYPE_VOID 1 //
#define IMAGE_SYM_TYPE_CHAR 2 // type character.
#define IMAGE_SYM_TYPE_SHORT 3 // type short integer.
#define IMAGE_SYM_TYPE_INT 4 //
#define IMAGE_SYM_TYPE_LONG 5 //
#define IMAGE_SYM_TYPE_FLOAT 6 //
#define IMAGE_SYM_TYPE_DOUBLE 7 //
#define IMAGE_SYM_TYPE_STRUCT 8 //
#define IMAGE_SYM_TYPE_UNION 9 //
#define IMAGE_SYM_TYPE_ENUM 10 // enumeration.
#define IMAGE_SYM_TYPE_MOE 11 // member of enumeration.
#define IMAGE_SYM_TYPE_BYTE 12 //
#define IMAGE_SYM_TYPE_WORD 13 //
#define IMAGE_SYM_TYPE_UINT 14 //
#define IMAGE_SYM_TYPE_DWORD 15 //
//
// Type (derived) values.
//
#define IMAGE_SYM_DTYPE_NULL 0 // no derived type.
#define IMAGE_SYM_DTYPE_POINTER 1 // pointer.
#define IMAGE_SYM_DTYPE_FUNCTION 2 // function.
#define IMAGE_SYM_DTYPE_ARRAY 3 // array.
//
// Storage classes.
//
#define IMAGE_SYM_CLASS_END_OF_FUNCTION (BYTE )-1
#define IMAGE_SYM_CLASS_NULL 0
#define IMAGE_SYM_CLASS_AUTOMATIC 1
#define IMAGE_SYM_CLASS_EXTERNAL 2
#define IMAGE_SYM_CLASS_STATIC 3
#define IMAGE_SYM_CLASS_REGISTER 4
#define IMAGE_SYM_CLASS_EXTERNAL_DEF 5
#define IMAGE_SYM_CLASS_LABEL 6
#define IMAGE_SYM_CLASS_UNDEFINED_LABEL 7
#define IMAGE_SYM_CLASS_MEMBER_OF_STRUCT 8
#define IMAGE_SYM_CLASS_ARGUMENT 9
#define IMAGE_SYM_CLASS_STRUCT_TAG 10
#define IMAGE_SYM_CLASS_MEMBER_OF_UNION 11
#define IMAGE_SYM_CLASS_UNION_TAG 12
#define IMAGE_SYM_CLASS_TYPE_DEFINITION 13
#define IMAGE_SYM_CLASS_UNDEFINED_STATIC 14
#define IMAGE_SYM_CLASS_ENUM_TAG 15
#define IMAGE_SYM_CLASS_MEMBER_OF_ENUM 16
#define IMAGE_SYM_CLASS_REGISTER_PARAM 17
#define IMAGE_SYM_CLASS_BIT_FIELD 18
#define IMAGE_SYM_CLASS_BLOCK 100
#define IMAGE_SYM_CLASS_FUNCTION 101
#define IMAGE_SYM_CLASS_END_OF_STRUCT 102
#define IMAGE_SYM_CLASS_FILE 103
// new
#define IMAGE_SYM_CLASS_SECTION 104
#define IMAGE_SYM_CLASS_WEAK_EXTERNAL 105
// type packing constants
#define N_BTMASK 017
#define N_TMASK 060
#define N_TMASK1 0300
#define N_TMASK2 0360
#define N_BTSHFT 4
#define N_TSHIFT 2
// MACROS
//
// Communal selection types.
//
#define IMAGE_COMDAT_SELECT_NODUPLICATES 1
#define IMAGE_COMDAT_SELECT_ANY 2
#define IMAGE_COMDAT_SELECT_SAME_SIZE 3
#define IMAGE_COMDAT_SELECT_EXACT_MATCH 4
#define IMAGE_COMDAT_SELECT_ASSOCIATIVE 5
#define IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1
#define IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2
#define IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3
//
// Relocation format.
//
typedef struct _IMAGE_RELOCATION {
UINT32 VirtualAddress;
UINT32 SymbolTableIndex;
UINT16 Type;
} IMAGE_RELOCATION;
#define IMAGE_SIZEOF_RELOCATION 10
//
// I386 relocation types.
//
#define IMAGE_REL_I386_ABSOLUTE 0 // Reference is absolute, no relocation is necessary
#define IMAGE_REL_I386_DIR16 01 // Direct 16-bit reference to the symbols virtual address
#define IMAGE_REL_I386_REL16 02 // PC-relative 16-bit reference to the symbols virtual address
#define IMAGE_REL_I386_DIR32 06 // Direct 32-bit reference to the symbols virtual address
#define IMAGE_REL_I386_DIR32NB 07 // Direct 32-bit reference to the symbols virtual address, base not included
#define IMAGE_REL_I386_SEG12 011 // Direct 16-bit reference to the segment-selector bits of a 32-bit virtual address
#define IMAGE_REL_I386_SECTION 012
#define IMAGE_REL_I386_SECREL 013
#define IMAGE_REL_I386_REL32 024 // PC-relative 32-bit reference to the symbols virtual address
//
// MIPS relocation types.
//
#define IMAGE_REL_MIPS_ABSOLUTE 0 // Reference is absolute, no relocation is necessary
#define IMAGE_REL_MIPS_REFHALF 01
#define IMAGE_REL_MIPS_REFWORD 02
#define IMAGE_REL_MIPS_JMPADDR 03
#define IMAGE_REL_MIPS_REFHI 04
#define IMAGE_REL_MIPS_REFLO 05
#define IMAGE_REL_MIPS_GPREL 06
#define IMAGE_REL_MIPS_LITERAL 07
#define IMAGE_REL_MIPS_SECTION 012
#define IMAGE_REL_MIPS_SECREL 013
#define IMAGE_REL_MIPS_REFWORDNB 042
#define IMAGE_REL_MIPS_PAIR 045
//
// Alpha Relocation types.
//
#define IMAGE_REL_ALPHA_ABSOLUTE 0x0
#define IMAGE_REL_ALPHA_REFLONG 0x1
#define IMAGE_REL_ALPHA_REFQUAD 0x2
#define IMAGE_REL_ALPHA_GPREL32 0x3
#define IMAGE_REL_ALPHA_LITERAL 0x4
#define IMAGE_REL_ALPHA_LITUSE 0x5
#define IMAGE_REL_ALPHA_GPDISP 0x6
#define IMAGE_REL_ALPHA_BRADDR 0x7
#define IMAGE_REL_ALPHA_HINT 0x8
#define IMAGE_REL_ALPHA_INLINE_REFLONG 0x9
#define IMAGE_REL_ALPHA_REFHI 0xA
#define IMAGE_REL_ALPHA_REFLO 0xB
#define IMAGE_REL_ALPHA_PAIR 0xC
#define IMAGE_REL_ALPHA_MATCH 0xD
#define IMAGE_REL_ALPHA_SECTION 0xE
#define IMAGE_REL_ALPHA_SECREL 0xF
#define IMAGE_REL_ALPHA_REFLONGNB 0x10
//
// IBM PowerPC relocation types.
//
#define IMAGE_REL_PPC_ABSOLUTE 0x0000 // NOP
#define IMAGE_REL_PPC_ADDR64 0x0001 // 64-bit address
#define IMAGE_REL_PPC_ADDR32 0x0002 // 32-bit address
#define IMAGE_REL_PPC_ADDR24 0x0003 // 26-bit address, shifted left 2 (branch absolute)
#define IMAGE_REL_PPC_ADDR16 0x0004 // 16-bit address
#define IMAGE_REL_PPC_ADDR14 0x0005 // 16-bit address, shifted left 2 (load doubleword)
#define IMAGE_REL_PPC_REL24 0x0006 // 26-bit PC-relative offset, shifted left 2 (branch relative)
#define IMAGE_REL_PPC_REL14 0x0007 // 16-bit PC-relative offset, shifted left 2 (br cond relative)
#define IMAGE_REL_PPC_TOCREL16 0x0008 // 16-bit offset from TOC base
#define IMAGE_REL_PPC_TOCREL14 0x0009 // 16-bit offset from TOC base, shifted left 2 (load doubleword)
#define IMAGE_REL_PPC_ADDR32NB 0x000A // 32-bit addr w/o image base
#define IMAGE_REL_PPC_SECREL 0x000B // va of containing section (as in an image sectionhdr)
#define IMAGE_REL_PPC_SECTION 0x000C // sectionheader number
#define IMAGE_REL_PPC_IFGLUE 0x000D // substitute TOC restore instruction iff symbol is glue code
#define IMAGE_REL_PPC_IMGLUE 0x000E // symbol is glue code; virtual address is TOC restore instruction
#define IMAGE_REL_PPC_TYPEMASK 0x00FF // mask to isolate above values in IMAGE_RELOCATION.Type
// Flag bits in IMAGE_RELOCATION.TYPE
#define IMAGE_REL_PPC_NEG 0x0100 // subtract reloc value rather than adding it
#define IMAGE_REL_PPC_BRTAKEN 0x0200 // fix branch prediction bit to predict branch taken
#define IMAGE_REL_PPC_BRNTAKEN 0x0400 // fix branch prediction bit to predict branch not taken
#define IMAGE_REL_PPC_TOCDEFN 0x0800 // toc slot defined in file (or, data in toc)
//
// Based relocation format.
//
typedef struct _IMAGE_BASE_RELOCATION {
UINT32 VirtualAddress;
UINT32 SizeOfBlock;
// UINT16 TypeOffset[1];
} IMAGE_BASE_RELOCATION, *PIMAGE_BASE_RELOCATION;
#define IMAGE_SIZEOF_BASE_RELOCATION 8
//
// Based relocation types.
//
#define IMAGE_REL_BASED_ABSOLUTE 0
#define IMAGE_REL_BASED_HIGH 1
#define IMAGE_REL_BASED_LOW 2
#define IMAGE_REL_BASED_HIGHLOW 3
#define IMAGE_REL_BASED_HIGHADJ 4
#define IMAGE_REL_BASED_MIPS_JMPADDR 5
#define IMAGE_REL_BASED_IA64_IMM64 9
#define IMAGE_REL_BASED_DIR64 10
//
// Line number format.
//
typedef struct _IMAGE_LINENUMBER {
union {
UINT32 SymbolTableIndex; // Symbol table index of function name if Linenumber is 0.
UINT32 VirtualAddress; // Virtual address of line number.
} Type;
UINT16 Linenumber; // Line number.
} IMAGE_LINENUMBER;
#define IMAGE_SIZEOF_LINENUMBER 6
//
// Archive format.
//
#define IMAGE_ARCHIVE_START_SIZE 8
#define IMAGE_ARCHIVE_START "!<arch>\n"
#define IMAGE_ARCHIVE_END "`\n"
#define IMAGE_ARCHIVE_PAD "\n"
#define IMAGE_ARCHIVE_LINKER_MEMBER "/ "
#define IMAGE_ARCHIVE_LONGNAMES_MEMBER "// "
typedef struct _IMAGE_ARCHIVE_MEMBER_HEADER {
UINT8 Name[16]; // File member name - `/' terminated.
UINT8 Date[12]; // File member date - decimal.
UINT8 UserID[6]; // File member user id - decimal.
UINT8 GroupID[6]; // File member group id - decimal.
UINT8 Mode[8]; // File member mode - octal.
UINT8 Size[10]; // File member size - decimal.
UINT8 EndHeader[2]; // String to end header.
} IMAGE_ARCHIVE_MEMBER_HEADER, *PIMAGE_ARCHIVE_MEMBER_HEADER;
#define IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60
//
// DLL support.
//
//
// Export Format
//
typedef struct _IMAGE_EXPORT_DIRECTORY {
UINT32 Characteristics;
UINT32 TimeDateStamp;
UINT16 MajorVersion;
UINT16 MinorVersion;
UINT32 Name;
UINT32 Base;
UINT32 NumberOfFunctions;
UINT32 NumberOfNames;
UINT32 *AddressOfFunctions;
UINT32 *AddressOfNames;
UINT32 *AddressOfNameOrdinals;
} IMAGE_EXPORT_DIRECTORY, *PIMAGE_EXPORT_DIRECTORY;
//
// Import Format
//
typedef struct _IMAGE_IMPORT_BY_NAME {
UINT16 Hint;
UINT8 Name[1];
} IMAGE_IMPORT_BY_NAME, *PIMAGE_IMPORT_BY_NAME;
typedef struct _IMAGE_THUNK_DATA {
union {
UINT32 Function;
UINT32 Ordinal;
PIMAGE_IMPORT_BY_NAME AddressOfData;
} u1;
} IMAGE_THUNK_DATA, *PIMAGE_THUNK_DATA;
#define IMAGE_ORDINAL_FLAG 0x80000000
#define IMAGE_SNAP_BY_ORDINAL(Ordinal) ((Ordinal & IMAGE_ORDINAL_FLAG) != 0)
#define IMAGE_ORDINAL(Ordinal) (Ordinal & 0xffff)
typedef struct _IMAGE_IMPORT_DESCRIPTOR {
UINT32 Characteristics;
UINT32 TimeDateStamp;
UINT32 ForwarderChain;
UINT32 Name;
PIMAGE_THUNK_DATA FirstThunk;
} IMAGE_IMPORT_DESCRIPTOR, *PIMAGE_IMPORT_DESCRIPTOR;
#endif
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
/*++
Copyright (c) 1998 Intel Corporation
Module Name:
efefind.h
Abstract:
EFI to compile bindings
Revision History
--*/
#ifndef X86_64_EFI_BIND
#define X86_64_EFI_BIND
#ifndef __GNUC__
#pragma pack()
#endif
#if defined(GNU_EFI_USE_MS_ABI)
#if (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)))||(defined(__clang__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 2)))
#define HAVE_USE_MS_ABI 1
#else
#error Compiler is too old for GNU_EFI_USE_MS_ABI
#endif
#endif
//
// Basic int types of various widths
//
#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L ) && !defined(__cplusplus)
// No ANSI C 1999/2000 stdint.h integer width declarations
#if defined(_MSC_EXTENSIONS)
// Use Microsoft C compiler integer width declarations
typedef unsigned __int64 uint64_t;
typedef __int64 int64_t;
typedef unsigned __int32 uint32_t;
typedef __int32 int32_t;
typedef unsigned short uint16_t;
typedef short int16_t;
typedef unsigned char uint8_t;
typedef char int8_t;
#elif defined(__GNUC__)
typedef int __attribute__((__mode__(__DI__))) int64_t;
typedef unsigned int __attribute__((__mode__(__DI__))) uint64_t;
typedef unsigned int uint32_t;
typedef int int32_t;
typedef unsigned short uint16_t;
typedef short int16_t;
typedef unsigned char uint8_t;
typedef signed char int8_t;
#elif defined(UNIX_LP64)
/* Use LP64 programming model from C_FLAGS for integer width declarations */
typedef unsigned long uint64_t;
typedef long int64_t;
typedef unsigned int uint32_t;
typedef int int32_t;
typedef unsigned short uint16_t;
typedef short int16_t;
typedef unsigned char uint8_t;
typedef char int8_t;
#else
/* Assume P64 programming model from C_FLAGS for integer width declarations */
typedef unsigned long long uint64_t __attribute__((aligned (8)));
typedef long long int64_t __attribute__((aligned (8)));
typedef unsigned int uint32_t;
typedef int int32_t;
typedef unsigned short uint16_t;
typedef short int16_t;
typedef unsigned char uint8_t;
typedef char int8_t;
#endif
typedef uint64_t uintptr_t;
typedef int64_t intptr_t;
#else
#include <stdint.h>
#endif
//
// Basic EFI types of various widths
//
#ifndef __WCHAR_TYPE__
# define __WCHAR_TYPE__ short
#endif
typedef uint64_t UINT64;
typedef int64_t INT64;
#ifndef _BASETSD_H_
typedef uint32_t UINT32;
typedef int32_t INT32;
#endif
typedef uint16_t UINT16;
typedef int16_t INT16;
typedef uint8_t UINT8;
typedef int8_t INT8;
typedef __WCHAR_TYPE__ WCHAR;
#undef VOID
#define VOID void
typedef int64_t INTN;
typedef uint64_t UINTN;
#ifdef EFI_NT_EMULATOR
#define POST_CODE(_Data)
#else
#ifdef EFI_DEBUG
#define POST_CODE(_Data) __asm mov eax,(_Data) __asm out 0x80,al
#else
#define POST_CODE(_Data)
#endif
#endif
#define EFIERR(a) (0x8000000000000000 | a)
#define EFI_ERROR_MASK 0x8000000000000000
#define EFIERR_OEM(a) (0xc000000000000000 | a)
#define BAD_POINTER 0xFBFBFBFBFBFBFBFB
#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFF
#ifdef EFI_NT_EMULATOR
#define BREAKPOINT() __asm { int 3 }
#else
#define BREAKPOINT() while (TRUE); // Make it hang on Bios[Dbg]32
#endif
//
// Pointers must be aligned to these address to function
//
#define MIN_ALIGNMENT_SIZE 4
#define ALIGN_VARIABLE(Value ,Adjustment) \
(UINTN)Adjustment = 0; \
if((UINTN)Value % MIN_ALIGNMENT_SIZE) \
(UINTN)Adjustment = MIN_ALIGNMENT_SIZE - ((UINTN)Value % MIN_ALIGNMENT_SIZE); \
Value = (UINTN)Value + (UINTN)Adjustment
//
// Define macros to build data structure signatures from characters.
//
#define EFI_SIGNATURE_16(A,B) ((A) | (B<<8))
#define EFI_SIGNATURE_32(A,B,C,D) (EFI_SIGNATURE_16(A,B) | (EFI_SIGNATURE_16(C,D) << 16))
#define EFI_SIGNATURE_64(A,B,C,D,E,F,G,H) (EFI_SIGNATURE_32(A,B,C,D) | ((UINT64)(EFI_SIGNATURE_32(E,F,G,H)) << 32))
//
// To export & import functions in the EFI emulator environment
//
#ifdef EFI_NT_EMULATOR
#define EXPORTAPI __declspec( dllexport )
#else
#define EXPORTAPI
#endif
//
// EFIAPI - prototype calling convention for EFI function pointers
// BOOTSERVICE - prototype for implementation of a boot service interface
// RUNTIMESERVICE - prototype for implementation of a runtime service interface
// RUNTIMEFUNCTION - prototype for implementation of a runtime function that is not a service
// RUNTIME_CODE - pragma macro for declaring runtime code
//
#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options
#ifdef _MSC_EXTENSIONS
#define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler
#elif defined(HAVE_USE_MS_ABI)
// Force amd64/ms calling conventions.
#define EFIAPI __attribute__((ms_abi))
#else
#define EFIAPI // Substitute expresion to force C calling convention
#endif
#endif
#define BOOTSERVICE
//#define RUNTIMESERVICE(proto,a) alloc_text("rtcode",a); proto a
//#define RUNTIMEFUNCTION(proto,a) alloc_text("rtcode",a); proto a
#define RUNTIMESERVICE
#define RUNTIMEFUNCTION
#define RUNTIME_CODE(a) alloc_text("rtcode", a)
#define BEGIN_RUNTIME_DATA() data_seg("rtdata")
#define END_RUNTIME_DATA() data_seg("")
#define VOLATILE volatile
#define MEMORY_FENCE()
#ifdef EFI_NT_EMULATOR
//
// To help ensure proper coding of integrated drivers, they are
// compiled as DLLs. In NT they require a dll init entry pointer.
// The macro puts a stub entry point into the DLL so it will load.
//
#define EFI_DRIVER_ENTRY_POINT(InitFunction) \
UINTN \
__stdcall \
_DllMainCRTStartup ( \
UINTN Inst, \
UINTN reason_for_call, \
VOID *rserved \
) \
{ \
return 1; \
} \
\
int \
EXPORTAPI \
__cdecl \
InitializeDriver ( \
void *ImageHandle, \
void *SystemTable \
) \
{ \
return InitFunction(ImageHandle, SystemTable); \
}
#define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \
(_if)->LoadInternal(type, name, NULL)
#else // EFI_NT_EMULATOR
//
// When build similiar to FW, then link everything together as
// one big module. For the MSVC toolchain, we simply tell the
// linker what our driver init function is using /ENTRY.
//
#if defined(_MSC_EXTENSIONS)
#define EFI_DRIVER_ENTRY_POINT(InitFunction) \
__pragma(comment(linker, "/ENTRY:" # InitFunction))
#else
#define EFI_DRIVER_ENTRY_POINT(InitFunction) \
UINTN \
InitializeDriver ( \
VOID *ImageHandle, \
VOID *SystemTable \
) \
{ \
return InitFunction(ImageHandle, \
SystemTable); \
} \
\
EFI_STATUS efi_main( \
EFI_HANDLE image, \
EFI_SYSTEM_TABLE *systab \
) __attribute__((weak, \
alias ("InitializeDriver")));
#endif
#define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \
(_if)->LoadInternal(type, name, entry)
#endif // EFI_NT_EMULATOR
//
// Some compilers don't support the forward reference construct:
// typedef struct XXXXX
//
// The following macro provide a workaround for such cases.
//
#ifdef NO_INTERFACE_DECL
#define INTERFACE_DECL(x)
#else
#if defined(__GNUC__) || defined(_MSC_EXTENSIONS)
#define INTERFACE_DECL(x) struct x
#else
#define INTERFACE_DECL(x) typedef struct x
#endif
#endif
/* for x86_64, EFI_FUNCTION_WRAPPER must be defined */
#if defined(HAVE_USE_MS_ABI)
#define uefi_call_wrapper(func, va_num, ...) func(__VA_ARGS__)
#else
/*
Credits for macro-magic:
https://groups.google.com/forum/?fromgroups#!topic/comp.std.c/d-6Mj5Lko_s
http://efesx.com/2010/08/31/overloading-macros/
*/
#define __VA_NARG__(...) \
__VA_NARG_(_0, ## __VA_ARGS__, __RSEQ_N())
#define __VA_NARG_(...) \
__VA_ARG_N(__VA_ARGS__)
#define __VA_ARG_N( \
_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,N,...) N
#define __RSEQ_N() \
10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
#define __VA_ARG_NSUFFIX__(prefix,...) \
__VA_ARG_NSUFFIX_N(prefix, __VA_NARG__(__VA_ARGS__))
#define __VA_ARG_NSUFFIX_N(prefix,nargs) \
__VA_ARG_NSUFFIX_N_(prefix, nargs)
#define __VA_ARG_NSUFFIX_N_(prefix,nargs) \
prefix ## nargs
/* Prototypes of EFI cdecl -> stdcall trampolines */
UINT64 efi_call0(void *func);
UINT64 efi_call1(void *func, UINT64 arg1);
UINT64 efi_call2(void *func, UINT64 arg1, UINT64 arg2);
UINT64 efi_call3(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3);
UINT64 efi_call4(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
UINT64 arg4);
UINT64 efi_call5(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
UINT64 arg4, UINT64 arg5);
UINT64 efi_call6(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
UINT64 arg4, UINT64 arg5, UINT64 arg6);
UINT64 efi_call7(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
UINT64 arg4, UINT64 arg5, UINT64 arg6, UINT64 arg7);
UINT64 efi_call8(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
UINT64 arg4, UINT64 arg5, UINT64 arg6, UINT64 arg7,
UINT64 arg8);
UINT64 efi_call9(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
UINT64 arg4, UINT64 arg5, UINT64 arg6, UINT64 arg7,
UINT64 arg8, UINT64 arg9);
UINT64 efi_call10(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
UINT64 arg4, UINT64 arg5, UINT64 arg6, UINT64 arg7,
UINT64 arg8, UINT64 arg9, UINT64 arg10);
/* Front-ends to efi_callX to avoid compiler warnings */
#define _cast64_efi_call0(f) \
efi_call0(f)
#define _cast64_efi_call1(f,a1) \
efi_call1(f, (UINT64)(a1))
#define _cast64_efi_call2(f,a1,a2) \
efi_call2(f, (UINT64)(a1), (UINT64)(a2))
#define _cast64_efi_call3(f,a1,a2,a3) \
efi_call3(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3))
#define _cast64_efi_call4(f,a1,a2,a3,a4) \
efi_call4(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4))
#define _cast64_efi_call5(f,a1,a2,a3,a4,a5) \
efi_call5(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4), \
(UINT64)(a5))
#define _cast64_efi_call6(f,a1,a2,a3,a4,a5,a6) \
efi_call6(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4), \
(UINT64)(a5), (UINT64)(a6))
#define _cast64_efi_call7(f,a1,a2,a3,a4,a5,a6,a7) \
efi_call7(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4), \
(UINT64)(a5), (UINT64)(a6), (UINT64)(a7))
#define _cast64_efi_call8(f,a1,a2,a3,a4,a5,a6,a7,a8) \
efi_call8(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4), \
(UINT64)(a5), (UINT64)(a6), (UINT64)(a7), (UINT64)(a8))
#define _cast64_efi_call9(f,a1,a2,a3,a4,a5,a6,a7,a8,a9) \
efi_call9(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4), \
(UINT64)(a5), (UINT64)(a6), (UINT64)(a7), (UINT64)(a8), \
(UINT64)(a9))
#define _cast64_efi_call10(f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) \
efi_call10(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4), \
(UINT64)(a5), (UINT64)(a6), (UINT64)(a7), (UINT64)(a8), \
(UINT64)(a9), (UINT64)(a10))
/* main wrapper (va_num ignored) */
#define uefi_call_wrapper(func,va_num,...) \
__VA_ARG_NSUFFIX__(_cast64_efi_call, __VA_ARGS__) (func , ##__VA_ARGS__)
#endif
#if defined(HAVE_USE_MS_ABI) && !defined(_MSC_EXTENSIONS)
#define EFI_FUNCTION __attribute__((ms_abi))
#else
#define EFI_FUNCTION
#endif
#ifdef _MSC_EXTENSIONS
#pragma warning ( disable : 4731 ) // Suppress warnings about modification of EBP
#endif
#endif
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
#ifndef GNU_EFI_X86_64_SETJMP_H
#define GNU_EFI_X86_64_SETJMP_H
#define JMPBUF_ALIGN 8
typedef struct {
UINT64 Rbx;
UINT64 Rsp;
UINT64 Rbp;
UINT64 Rdi;
UINT64 Rsi;
UINT64 R12;
UINT64 R13;
UINT64 R14;
UINT64 R15;
UINT64 Rip;
UINT64 MxCsr;
UINT8 XmmBuffer[160]; // XMM6 - XMM15
} ALIGN(JMPBUF_ALIGN) jmp_buf[1];
#endif /* GNU_EFI_X86_64_SETJMP_H */
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
/*
* Copyright (C) 2013 Jerry Hoemann <[email protected]>
*
*
* Application to allocate memory at EFI. Syntax of command
* mimics the EFI Boot Service "AllocatePages."
*
* See UEFI spec 2.3, Section 6.2.
*
*
FS1:\> memmap
Type Start End #pages Attributes
BS_Code 0000000000000000-0000000000000FFF 0000000000000001 000000000000000F
Available 0000000000001000-000000000008DFFF 000000000000008D 000000000000000F
Reserved 000000000008E000-000000000008FFFF 0000000000000002 000000000000000F
Available 0000000000090000-000000000009FFFF 0000000000000010 000000000000000F
Available 0000000000100000-000000000FFFFFFF 000000000000FF00 000000000000000F
BS_Code 0000000010000000-0000000010061FFF 0000000000000062 000000000000000F
Available 0000000010062000-000000005CDFFFFF 000000000004CD9E 000000000000000F
ACPI_NVS 000000005CE00000-000000005DDFFFFF 0000000000001000 000000000000000F
BS_Data 000000005DE00000-000000005DFFFFFF 0000000000000200 000000000000000F
Available 000000005E000000-000000005EF1CFFF 0000000000000F1D 000000000000000F
BS_Data 000000005EF1D000-00000000709FBFFF 0000000000011ADF 000000000000000F
Available 00000000709FC000-00000000710E3FFF 00000000000006E8 000000000000000F
LoaderCode 00000000710E4000-00000000711FEFFF 000000000000011B 000000000000000F
Available 00000000711FF000-0000000071901FFF 0000000000000703 000000000000000F
BS_Code 0000000071902000-00000000721FEFFF 00000000000008FD 000000000000000F
Example to allocat 5 pages type BootCode at address 20000000 (hex)
FS1:\> AllocPages.efi 2 3 5 20000000
AllocatePage: __AllocType__ __MemType__ __NumPages__ [__Addr__]
__AllocType__ {0,1,2} -- Any, MaxAddr, Addr
__MemType__ {0..13}, Reserved ==0, LCode==1, LData==2, BSCode==3, BSData==4, ...
__NumPages__ {0..F000000}
[__Addr__] 0... 3FFFFFFFFFFF
All numbers in hex no leading 0x
AllocatPage(2,3,5,20000000)
Example to allocat 5 pages type BootCode at address 30000000 (hex)
FS1:\> AllocPages.efi 2 3 5 30000000
AllocatePage: __AllocType__ __MemType__ __NumPages__ [__Addr__]
__AllocType__ {0,1,2} -- Any, MaxAddr, Addr
__MemType__ {0..13}, Reserved ==0, LCode==1, LData==2, BSCode==3, BSData==4, ...
__NumPages__ {0..F000000}
[__Addr__] 0... 3FFFFFFFFFFF
All numbers in hex no leading 0x
FS1:\> memmap
Type Start End #pages Attributes
BS_Code 0000000000000000-0000000000000FFF 0000000000000001 000000000000000F
Available 0000000000001000-000000000008DFFF 000000000000008D 000000000000000F
Reserved 000000000008E000-000000000008FFFF 0000000000000002 000000000000000F
Available 0000000000090000-000000000009FFFF 0000000000000010 000000000000000F
Available 0000000000100000-000000000FFFFFFF 000000000000FF00 000000000000000F
BS_Code 0000000010000000-0000000010061FFF 0000000000000062 000000000000000F
Available 0000000010062000-000000001FFFFFFF 000000000000FF9E 000000000000000F
BS_Code 0000000020000000-0000000020004FFF 0000000000000005 000000000000000F
Available 0000000020005000-000000002FFFFFFF 000000000000FFFB 000000000000000F
BS_Code 0000000030000000-0000000030004FFF 0000000000000005 000000000000000F
Available 0000000030005000-000000005CDFFFFF 000000000002CDFB 000000000000000F
ACPI_NVS 000000005CE00000-000000005DDFFFFF 0000000000001000 000000000000000F
BS_Data 000000005DE00000-000000005DFFFFFF 0000000000000200 000000000000000F
Available 000000005E000000-000000005EF1CFFF 0000000000000F1D 000000000000000F
BS_Data 000000005EF1D000-00000000709FBFFF 0000000000011ADF 000000000000000F
Available 00000000709FC000-00000000710E3FFF 00000000000006E8 000000000000000F
LoaderCode 00000000710E4000-00000000711FEFFF 000000000000011B 000000000000000F
Available 00000000711FF000-0000000071901FFF 0000000000000703 000000000000000F
BS_Code 0000000071902000-00000000721FEFFF 00000000000008FD 000000000000000F
*/
#include <efi.h>
#include <efilib.h>
#define MAX_NUM_PAGES 0x000000000F000000
#define MAX_ADDR ((1ULL << 46) - 1)
#ifdef DEBUG
#undef DEBUG
#endif
#define DEBUG 0
EFI_STATUS
efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
{
EFI_STATUS efi_status;
CHAR16 **argv;
INTN argc;
INTN err = 0;
#if DEBUG
INTN c = 0;
#endif
INTN AllocType = -1;
INTN MemType = -1;
INTN NumPages = -1;
EFI_PHYSICAL_ADDRESS Addr = 0;
InitializeLib(image, systab);
Print(L"AllocatePage: __AllocType__ __MemType__ __NumPages__ [__Addr__]\n");
Print(L"__AllocType__ {0,1,2} -- Any, MaxAddr, Addr\n");
Print(L"__MemType__ {0..13}, Reserved ==0, LCode==1, LData==2, BSCode==3, BSData==4, ...\n");
Print(L"__NumPages__ {0..%x}\n", MAX_NUM_PAGES);
Print(L"[__Addr__] 0... %llx\n", MAX_ADDR);
Print(L"All numbers in hex no leading 0x\n");
Print(L"\n");
#if DEBUG
Print(L"Now get argc/argv\n");
#endif
argc = GetShellArgcArgv(image, &argv);
#if DEBUG
Print(L"argc = %d\n", argc);
#endif
#if DEBUG
for (c = 0; c < argc; c++ ) {
Print(L"argv[%d] = <%s>\n", c, argv[c]);
}
#endif
if ( (argc < 4) || (argc > 5) ) {
Print(L"Wrong argument count\n");
return EFI_SUCCESS;
}
AllocType = xtoi(argv[1]);
MemType = xtoi(argv[2]);
NumPages = xtoi(argv[3]);
if ( argc == 5 ) Addr = xtoi(argv[4]);
if ( (AllocType < 0) || (AllocType > 2)) {
Print(L"Invalid AllocType\n");
err++;
}
if ( (MemType < 0) || (MemType > 13) ) {
Print(L"Invalid MemType\n");
err++;
}
if ( (NumPages < 0) || (NumPages > MAX_NUM_PAGES) ) {
Print(L"Inavlid NumPages\n");
err++;
}
if ( Addr > MAX_ADDR ) {
Print(L"Inavlid Address\n");
err++;
}
if ( err ) {
return EFI_INVALID_PARAMETER;
}
Print(L"AllocatPage(%d,%d,%d,%lx)\n", AllocType, MemType, NumPages, Addr);
efi_status = uefi_call_wrapper(BS->AllocatePages, 4, AllocType, MemType, NumPages, &Addr);
if ( EFI_ERROR(efi_status) ) {
Print(L"Allocate Pages Failed: %d\n", efi_status);
return efi_status;
}
return EFI_SUCCESS;
}
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
#include <efi.h>
#include <efilib.h>
extern EFI_GUID GraphicsOutputProtocol;
static void
print_modes(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop)
{
int i, imax;
EFI_STATUS rc;
if (gop->Mode) {
imax = gop->Mode->MaxMode;
Print(L"GOP reports MaxMode %d\n", imax);
} else {
Print(L"gop->Mode is NULL\n");
imax = 1;
}
for (i = 0; i < imax; i++) {
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *info;
UINTN SizeOfInfo;
rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i, &SizeOfInfo,
&info);
if (EFI_ERROR(rc) && rc == EFI_NOT_STARTED) {
Print(L"gop->QueryMode() returned %r\n", rc);
Print(L"Trying to start GOP with SetMode().\n");
rc = uefi_call_wrapper(gop->SetMode, 2, gop,
gop->Mode ? gop->Mode->Mode : 0);
rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i,
&SizeOfInfo, &info);
}
if (EFI_ERROR(rc)) {
Print(L"%d: Bad response from QueryMode: %r (%d)\n",
i, rc, rc);
continue;
}
Print(L"%c%d: %dx%d ",
(gop->Mode &&
CompareMem(info,gop->Mode->Info,sizeof(*info)) == 0
) ? '*' : ' ',
i, info->HorizontalResolution, info->VerticalResolution);
switch(info->PixelFormat) {
case PixelRedGreenBlueReserved8BitPerColor:
Print(L"RGBR");
break;
case PixelBlueGreenRedReserved8BitPerColor:
Print(L"BGRR");
break;
case PixelBitMask:
Print(L"R:%08x G:%08x B:%08x X:%08x",
info->PixelInformation.RedMask,
info->PixelInformation.GreenMask,
info->PixelInformation.BlueMask,
info->PixelInformation.ReservedMask);
break;
case PixelBltOnly:
Print(L"(blt only)");
break;
default:
Print(L"(Invalid pixel format)");
break;
}
Print(L" pitch %d\n", info->PixelsPerScanLine);
}
}
static EFI_STATUS
SetWatchdog(UINTN seconds)
{
EFI_STATUS rc;
rc = uefi_call_wrapper(BS->SetWatchdogTimer, 4, seconds, 0x1ffff,
0, NULL);
if (EFI_ERROR(rc)) {
CHAR16 Buffer[64];
StatusToString(Buffer, rc);
Print(L"Bad response from QueryMode: %s (%d)\n", Buffer, rc);
}
return rc;
}
EFI_STATUS
efi_main (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *systab)
{
EFI_STATUS rc;
EFI_GRAPHICS_OUTPUT_PROTOCOL *gop;
InitializeLib(image_handle, systab);
SetWatchdog(10);
rc = LibLocateProtocol(&GraphicsOutputProtocol, (void **)&gop);
if (EFI_ERROR(rc)) {
Print(L"Could not locate GOP: %r\n", rc);
return rc;
}
if (!gop) {
Print(L"LocateProtocol(GOP, &gop) returned %r but GOP is NULL\n", rc);
return EFI_UNSUPPORTED;
}
print_modes(gop);
SetWatchdog(0);
return EFI_SUCCESS;
}
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
/*
* Copyright (C) 2013 Jerry Hoemann <[email protected]>
*
* Application to allocate memory at EFI. Syntax of command
* mimics the EFI Boot Service "FreePages."
*
* See UEFI spec 2.3, Section 6.2.
*
Example freeing a 5 page BS_Code setment at address: 0000000020000000 (hex)
FS1:\> memmap
Type Start End #pages Attributes
BS_Code 0000000000000000-0000000000000FFF 0000000000000001 000000000000000F
Available 0000000000001000-000000000008DFFF 000000000000008D 000000000000000F
Reserved 000000000008E000-000000000008FFFF 0000000000000002 000000000000000F
Available 0000000000090000-000000000009FFFF 0000000000000010 000000000000000F
Available 0000000000100000-000000000FFFFFFF 000000000000FF00 000000000000000F
BS_Code 0000000010000000-0000000010061FFF 0000000000000062 000000000000000F
Available 0000000010062000-000000001FFFFFFF 000000000000FF9E 000000000000000F
BS_Code 0000000020000000-0000000020004FFF 0000000000000005 000000000000000F
Available 0000000020005000-000000005DDFFFFF 000000000003DDFB 000000000000000F
BS_Data 000000005DE00000-000000005DFFFFFF 0000000000000200 000000000000000F
Available 000000005E000000-000000006DE7CFFF 000000000000FE7D 000000000000000F
ACPI_NVS 000000006DE7D000-000000006EE7CFFF 0000000000001000 000000000000000F
BS_Data 000000006EE7D000-00000000709FBFFF 0000000000001B7F 000000000000000F
Available 00000000709FC000-00000000710E3FFF 00000000000006E8 000000000000000F
FS1:\> FreePages 0000000020000000 5
FreePages: __PhysAddr__ __PgCnt__
__PhysAddr__ 0... 3FFFFFFFFFFF
__PgCnt__ [0..F000000]
All numbers hex w/ no leading 0x
FreePages(20000000,5)
FS1:\> memmap
Type Start End #pages Attributes
BS_Code 0000000000000000-0000000000000FFF 0000000000000001 000000000000000F
Available 0000000000001000-000000000008DFFF 000000000000008D 000000000000000F
Reserved 000000000008E000-000000000008FFFF 0000000000000002 000000000000000F
Available 0000000000090000-000000000009FFFF 0000000000000010 000000000000000F
Available 0000000000100000-000000000FFFFFFF 000000000000FF00 000000000000000F
BS_Code 0000000010000000-0000000010061FFF 0000000000000062 000000000000000F
Available 0000000010062000-000000005DDFFFFF 000000000004DD9E 000000000000000F
BS_Data 000000005DE00000-000000005DFFFFFF 0000000000000200 000000000000000F
Available 000000005E000000-000000006DE7CFFF 000000000000FE7D 000000000000000F
ACPI_NVS 000000006DE7D000-000000006EE7CFFF 0000000000001000 000000000000000F
BS_Data 000000006EE7D000-00000000709FBFFF 0000000000001B7F 000000000000000F
Available 00000000709FC000-00000000710E3FFF 00000000000006E8 000000000000000F
*/
#include <efi.h>
#include <efilib.h>
/*
* FreePages: __PhysAddr__ __PgCnt__
*
*/
#define MAX_NUM_PAGES 0x000000000F000000
#define MAX_ADDR ((1ULL << 46) - 1)
#ifdef DEBUG
#undef DEBUG
#endif
#define DEBUG 0
EFI_STATUS
efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
{
EFI_STATUS efi_status;
CHAR16 **argv;
INTN argc = 0;
#if DEBUG
INTN c = 0;
#endif
INTN err = 0;
INTN PgCnt = -1;
EFI_PHYSICAL_ADDRESS PhysAddr = 0;
InitializeLib(image, systab);
Print(L"FreePages: __PhysAddr__ __PgCnt__\n");
Print(L"__PhysAddr__ 0... %llx\n", MAX_ADDR);
Print(L"__PgCnt__ [0..%lx]\n", MAX_NUM_PAGES);
Print(L"All numbers hex w/ no leading 0x\n");
Print(L"\n");
#if DEBUG
Print(L"Now parse argc/argv\n");
#endif
argc = GetShellArgcArgv(image, &argv);
#if DEBUG
Print(L"argc = %d\n", argc);
#endif
#if DEBUG
for (c = 0; c < argc; c++ ) {
Print(L"argv[%d] = <%s>\n", c, argv[c]);
}
#endif
if (argc != 3) {
Print(L"Invalid argument count\n");
return EFI_SUCCESS;
}
PhysAddr = xtoi(argv[1]);
PgCnt = xtoi(argv[2]);
if ( (PgCnt < 0) || (PgCnt > MAX_NUM_PAGES) ) {
Print(L"Inavlid PgCnt\n");
err++;
}
if ( PhysAddr > MAX_ADDR ) {
Print(L"Inavlid Address\n");
err++;
}
if ( err ) {
return EFI_SUCCESS;
}
Print(L"FreePages(%lx,%d)\n", PhysAddr, PgCnt);
efi_status = uefi_call_wrapper(BS->FreePages, 2, PhysAddr, PgCnt);
if ( EFI_ERROR(efi_status) ) {
Print(L"Free Pages Failed: %d\n", efi_status);
return efi_status;
}
return EFI_SUCCESS;
}
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
/*
* Copyright (C) 2013 David Decotigny <[email protected]>
*
* Sample EFI shell session, together with drv0_use.efi:
*
* # Loading first instance:
*
* fs0:\> load drv0.efi
* Driver instance loaded successfully.
* load: Image fs0:\drv0.efi loaded at 2FD7C000 - Success
*
* # Testing 1st instance:
*
* fs0:\> drv0_use.efi
* Playing with driver instance 0...
* Hello Sample UEFI Driver!
* Hello was called 1 time(s).
*
* fs0:\> drv0_use.efi
* Playing with driver instance 0...
* Hello Sample UEFI Driver!
* Hello was called 2 time(s).
*
* # Loading another instance:
*
* fs0:\> load drv0.efi
* Driver instance loaded successfully.
* load: Image fs0:\drv0.efi loaded at 2FD6D000 - Success
*
* # Using both instances:
*
* fs0:\> drv0_use.efi
* Playing with driver instance 0...
* Hello Sample UEFI Driver!
* Hello was called 3 time(s).
* Playing with driver instance 1...
* Hello Sample UEFI Driver!
* Hello was called 1 time(s).
*
* fs0:\> drv0_use.efi
* Playing with driver instance 0...
* Hello Sample UEFI Driver!
* Hello was called 4 time(s).
* Playing with driver instance 1...
* Hello Sample UEFI Driver!
* Hello was called 2 time(s).
*
* # Removing 1st instance:
*
* fs0:\> dh
* Handle dump
* 1: Image(DxeCore)
* [...]
* 79: Image(\/drv0.efi) ImageDevPath (..A,0x800,0x17F7DF)/\/drv0.efi)
* 7A: Image(\/drv0.efi) ImageDevPath (..A,0x800,0x17F7DF)/\/drv0.efi)
*
* fs0:\> unload 79
* 79: Image(\/drv0.efi) ImageDevPath (..A,0x800,0x17F7DF)/\/drv0.efi)
* Unload driver image (y/n)? y
* Driver instance unloaded.
* unload: Success
*
* # Only 2nd instance remaining:
*
* fs0:\> drv0_use.efi
* Playing with driver instance 0...
* Hello Sample UEFI Driver!
* Hello was called 3 time(s).
*
* # Removing 2nd/last instance:
*
* fs0:\> dh
* Handle dump
* 1: Image(DxeCore)
* [...]
* 79: Image(\/drv0.efi) ImageDevPath (..A,0x800,0x17F7DF)/\/drv0.efi)
*
* fs0:\> unload 79
* 79: Image(\/drv0.efi) ImageDevPath (..A,0x800,0x17F7DF)/\/drv0.efi)
* Unload driver image (y/n)? y
* Driver instance unloaded.
* unload: Success
*
* # Expect error: no other drv0 instance left
*
* fs0:\> drv0_use.efi
* Error looking up handles for proto: 14
*/
#include <efi.h>
#include <efilib.h>
#include "drv0.h"
static const EFI_GUID GnuEfiAppsDrv0ProtocolGuid
= GNU_EFI_APPS_DRV0_PROTOCOL_GUID;
static struct {
GNU_EFI_APPS_DRV0_PROTOCOL Proto;
UINTN Counter;
} InternalGnuEfiAppsDrv0ProtocolData;
static
EFI_STATUS
EFI_FUNCTION
Drv0SayHello(
IN const CHAR16 *HelloWho
)
{
if (! HelloWho)
return EFI_INVALID_PARAMETER;
Print(L"Hello %s!\n", HelloWho);
InternalGnuEfiAppsDrv0ProtocolData.Counter ++;
return EFI_SUCCESS;
}
static
EFI_STATUS
EFI_FUNCTION
Drv0GetNumberOfHello(
OUT UINTN *NumberOfHello
)
{
if (! NumberOfHello)
return EFI_INVALID_PARAMETER;
*NumberOfHello = InternalGnuEfiAppsDrv0ProtocolData.Counter;
return EFI_SUCCESS;
}
static
EFI_STATUS
EFI_FUNCTION
Drv0Unload(IN EFI_HANDLE ImageHandle)
{
LibUninstallProtocolInterfaces(ImageHandle,
&GnuEfiAppsDrv0ProtocolGuid,
&InternalGnuEfiAppsDrv0ProtocolData.Proto,
NULL);
Print(L"Driver instance unloaded.\n", ImageHandle);
return EFI_SUCCESS;
}
EFI_STATUS
efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SysTab)
{
EFI_STATUS Status;
EFI_LOADED_IMAGE *LoadedImage = NULL;
InitializeLib(ImageHandle, SysTab);
/* Initialize global protocol definition + data */
InternalGnuEfiAppsDrv0ProtocolData.Proto.SayHello
= (GNU_EFI_APPS_DRV0_SAY_HELLO) Drv0SayHello;
InternalGnuEfiAppsDrv0ProtocolData.Proto.GetNumberOfHello
= (GNU_EFI_APPS_DRV0_GET_NUMBER_OF_HELLO) Drv0GetNumberOfHello;
InternalGnuEfiAppsDrv0ProtocolData.Counter = 0;
/* Grab handle to this image: we'll attach our proto instance to it */
Status = uefi_call_wrapper(BS->OpenProtocol, 6,
ImageHandle, &LoadedImageProtocol,
(void**)&LoadedImage, ImageHandle,
NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
if (EFI_ERROR(Status)) {
Print(L"Could not open loaded image protocol: %d\n", Status);
return Status;
}
/* Attach our proto to the current driver image */
Status = LibInstallProtocolInterfaces(
&ImageHandle, &GnuEfiAppsDrv0ProtocolGuid,
&InternalGnuEfiAppsDrv0ProtocolData.Proto, NULL);
if (EFI_ERROR(Status)) {
Print(L"Error registering driver instance: %d\n", Status);
return Status;
}
/* Register Unload callback, used to unregister current protocol
* instance from system */
LoadedImage->Unload = (EFI_IMAGE_UNLOAD)Drv0Unload;
Print(L"Driver instance loaded successfully.\n");
return EFI_SUCCESS; /* at this point, this instance stays resident
* until image is unloaded, eg. with shell's unload,
* ExitBootServices() */
}
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
#include <efi.h>
#include <efilib.h>
extern EFI_GUID GraphicsOutputProtocol;
static void
fill_boxes(UINT32 *PixelBuffer, UINT32 Width, UINT32 Height)
{
UINT32 y, x = 0;
/*
* This assums BGRR, but it doesn't really matter; we pick red and
* green so it'll just be blue/green if the pixel format is backwards.
*/
EFI_GRAPHICS_OUTPUT_BLT_PIXEL Red = {0, 0, 0xff, 0},
Green = {0, 0xff, 0, 0},
*Color;
for (y = 0; y < Height; y++) {
Color = ((y / 32) % 2 == 0) ? &Red : &Green;
for (x = 0; x < Width; x++) {
if (x % 32 == 0 && x != 0)
Color = (Color == &Red) ? &Green : &Red;
PixelBuffer[y * Width + x] = *(UINT32 *)Color;
}
}
}
static void
draw_boxes(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop)
{
int i, imax;
EFI_STATUS rc;
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *info;
UINTN NumPixels;
UINT32 *PixelBuffer;
UINT32 BufferSize;
if (gop->Mode) {
imax = gop->Mode->MaxMode;
} else {
Print(L"gop->Mode is NULL\n");
return;
}
for (i = 0; i < imax; i++) {
UINTN SizeOfInfo;
rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i, &SizeOfInfo,
&info);
if (EFI_ERROR(rc) && rc == EFI_NOT_STARTED) {
Print(L"gop->QueryMode() returned %r\n", rc);
Print(L"Trying to start GOP with SetMode().\n");
rc = uefi_call_wrapper(gop->SetMode, 2, gop,
gop->Mode ? gop->Mode->Mode : 0);
rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i,
&SizeOfInfo, &info);
}
if (EFI_ERROR(rc)) {
Print(L"%d: Bad response from QueryMode: %r (%d)\n",
i, rc, rc);
continue;
}
if (CompareMem(info, gop->Mode->Info, sizeof (*info)))
continue;
NumPixels = info->VerticalResolution * info->HorizontalResolution;
BufferSize = NumPixels * sizeof(UINT32);
PixelBuffer = AllocatePool(BufferSize);
if (!PixelBuffer) {
Print(L"Allocation of 0x%08lx bytes failed.\n",
sizeof(UINT32) * NumPixels);
return;
}
fill_boxes(PixelBuffer,
info->HorizontalResolution, info->VerticalResolution);
uefi_call_wrapper(gop->Blt, 10, gop,
(EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)PixelBuffer,
EfiBltBufferToVideo,
0, 0, 0, 0,
info->HorizontalResolution,
info->VerticalResolution,
0);
return;
}
Print(L"Never found the active video mode?\n");
}
static EFI_STATUS
SetWatchdog(UINTN seconds)
{
EFI_STATUS rc;
rc = uefi_call_wrapper(BS->SetWatchdogTimer, 4, seconds, 0x1ffff,
0, NULL);
if (EFI_ERROR(rc)) {
CHAR16 Buffer[64];
StatusToString(Buffer, rc);
Print(L"Bad response from QueryMode: %s (%d)\n", Buffer, rc);
}
return rc;
}
EFI_STATUS
efi_main (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *systab)
{
EFI_STATUS rc;
EFI_GRAPHICS_OUTPUT_PROTOCOL *gop;
InitializeLib(image_handle, systab);
SetWatchdog(10);
rc = LibLocateProtocol(&GraphicsOutputProtocol, (void **)&gop);
if (EFI_ERROR(rc)) {
Print(L"Could not locate GOP: %r\n", rc);
return rc;
}
if (!gop) {
Print(L"LocateProtocol(GOP, &gop) returned %r but GOP is NULL\n", rc);
return EFI_UNSUPPORTED;
}
draw_boxes(gop);
SetWatchdog(0);
return EFI_SUCCESS;
}
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
#include <efi.h>
#include <efilib.h>
/* this example program changes the Reserved Page Route (RPR) bit on ICH10's General
* Control And Status Register (GCS) from LPC to PCI. In practical terms, it routes
* outb to port 80h to the PCI bus. */
#define GCS_OFFSET_ADDR 0x3410
#define GCS_RPR_SHIFT 2
#define GCS_RPR_PCI 1
#define GCS_RPR_LPC 0
#define VENDOR_ID_INTEL 0x8086
#define DEVICE_ID_LPCIF 0x3a16
#define DEVICE_ID_COUGARPOINT_LPCIF 0x1c56
static EFI_HANDLE ImageHandle;
typedef struct {
uint16_t vendor_id; /* 00-01 */
uint16_t device_id; /* 02-03 */
char pad[0xEB]; /* 04-EF */
uint32_t rcba; /* F0-F3 */
uint32_t reserved[3]; /* F4-FF */
} lpcif_t;
static inline void set_bit(volatile uint32_t *flag, int bit, int value)
{
uint32_t val = *flag;
Print(L"current value is 0x%2x\n", val);
if (value) {
val |= (1 << bit);
} else {
val &= ~(1 << bit);
}
Print(L"setting value to 0x%2x\n", val);
*flag = val;
val = *flag;
Print(L"new value is 0x%2x\n", val);
}
static int is_device(EFI_PCI_IO *pciio, uint16_t vendor_id, uint16_t device_id)
{
lpcif_t lpcif;
EFI_STATUS rc;
rc = uefi_call_wrapper(pciio->Pci.Read, 5, pciio, EfiPciIoWidthUint16, 0, 2, &lpcif);
if (EFI_ERROR(rc))
return 0;
if (vendor_id == lpcif.vendor_id && device_id == lpcif.device_id)
return 1;
return 0;
}
static EFI_STATUS find_pci_device(uint16_t vendor_id, uint16_t device_id,
EFI_PCI_IO **pciio)
{
EFI_STATUS rc;
EFI_HANDLE *Handles;
UINTN NoHandles, i;
if (!pciio)
return EFI_INVALID_PARAMETER;
rc = LibLocateHandle(ByProtocol, &PciIoProtocol, NULL, &NoHandles,
&Handles);
if (EFI_ERROR(rc))
return rc;
for (i = 0; i < NoHandles; i++) {
void *pciio_tmp = NULL;
rc = uefi_call_wrapper(BS->OpenProtocol, 6, Handles[i],
&PciIoProtocol, &pciio_tmp, ImageHandle,
NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
if (EFI_ERROR(rc))
continue;
*pciio = pciio_tmp;
if (!is_device(*pciio, vendor_id, device_id)) {
*pciio = NULL;
continue;
}
return EFI_SUCCESS;
}
return EFI_NOT_FOUND;
}
EFI_STATUS
efi_main (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *systab)
{
InitializeLib(image_handle, systab);
EFI_PCI_IO *pciio = NULL;
lpcif_t lpcif;
EFI_STATUS rc = EFI_SUCCESS;
struct {
uint16_t vendor;
uint16_t device;
} devices[] = {
{ VENDOR_ID_INTEL, DEVICE_ID_LPCIF },
{ VENDOR_ID_INTEL, DEVICE_ID_COUGARPOINT_LPCIF },
{ 0, 0 }
};
int i;
ImageHandle = image_handle;
for (i = 0; devices[i].vendor != 0; i++) {
rc = find_pci_device(devices[i].vendor, devices[i].device, &pciio);
if (EFI_ERROR(rc))
continue;
}
if (rc == EFI_NOT_FOUND) {
Print(L"Device not found.\n");
return rc;
} else if (EFI_ERROR(rc)) {
return rc;
}
rc = uefi_call_wrapper(pciio->Pci.Read, 5, pciio, EfiPciIoWidthUint32,
EFI_FIELD_OFFSET(lpcif_t, rcba), 1, &lpcif.rcba);
if (EFI_ERROR(rc))
return rc;
if (!(lpcif.rcba & 1)) {
Print(L"rcrb is not mapped, cannot route port 80h\n");
return EFI_UNSUPPORTED;
}
lpcif.rcba &= ~1UL;
Print(L"rcba: 0x%8x\n", lpcif.rcba, lpcif.rcba);
set_bit((uint32_t *)(intptr_t)(lpcif.rcba + GCS_OFFSET_ADDR),
GCS_RPR_SHIFT, GCS_RPR_PCI);
return EFI_SUCCESS;
}
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
#include <efi.h>
#include <efilib.h>
EFI_STATUS
efi_main (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *systab)
{
InitializeLib(image_handle, systab);
Exit(EFI_SUCCESS, 0, NULL);
return EFI_UNSUPPORTED;
}
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
#include <efi.h>
#include <efilib.h>
EFI_STATUS
efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
{
INTN Argc, i;
CHAR16 **Argv;
InitializeLib(ImageHandle, SystemTable);
Argc = GetShellArgcArgv(ImageHandle, &Argv);
Print(L"Hello World, started with Argc=%d\n", Argc);
for (i = 0 ; i < Argc ; ++i)
Print(L" Argv[%d] = '%s'\n", i, Argv[i]);
Print(L"Bye.\n");
return EFI_SUCCESS;
}
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
#include <efi.h>
#include <efilib.h>
EFI_STATUS
efi_main (EFI_HANDLE *image, EFI_SYSTEM_TABLE *systab)
{
UINTN index;
InitializeLib(image, systab);
uefi_call_wrapper(systab->ConOut->OutputString, 2, systab->ConOut, L"Hello application started\r\n");
uefi_call_wrapper(systab->ConOut->OutputString, 2, systab->ConOut, L"\r\n\r\n\r\nHit any key to exit\r\n");
uefi_call_wrapper(systab->BootServices->WaitForEvent, 3, 1, &systab->ConIn->WaitForKey, &index);
return EFI_SUCCESS;
}
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
.text
.align 4
.globl _start
_start:
#if 0
pushl %ebp
movl %esp,%ebp
pushl %ebx # save ebx
movl 12(%ebp),%eax # eax <- systab
movl 24(%eax),%ebx # ebx <- systab->FirmwareVendor
pushl %ebx
movl 44(%eax),%ebx # ebx <- systab->ConOut
pushl %ebx
movl 4(%ebx),%eax # eax <- conout->OutputString
call *%eax
movl -4(%ebp),%ebx # restore ebx
leave
ret
#else
pushl %ebp
movl %esp,%ebp
pushl %ebx
call 0f
0: popl %eax
addl $hello-0b,%eax
pushl %eax
movl 12(%ebp),%eax # eax <- systab
movl 44(%eax),%ebx # ebx <- systab->ConOut
pushl %ebx
movl 4(%ebx),%eax # eax <- conout->OutputString
call *%eax
movl -4(%ebp),%ebx
leave
ret
.section .rodata
.align 2
hello: .byte 'h',0,'e',0,'l',0,'l',0,'o',0,'\n',0,'\r',0,0,0
#endif
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
#include <efi.h>
#include <efilib.h>
static CHAR16 *
a2u (char *str)
{
static CHAR16 mem[2048];
int i;
for (i = 0; str[i]; ++i)
mem[i] = (CHAR16) str[i];
mem[i] = 0;
return mem;
}
EFI_STATUS
efi_main (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *systab)
{
SIMPLE_TEXT_OUTPUT_INTERFACE *conout;
InitializeLib(image_handle, systab);
conout = systab->ConOut;
uefi_call_wrapper(conout->OutputString, 2, conout, (CHAR16 *)L"Hello World!\n\r");
uefi_call_wrapper(conout->OutputString, 2, conout, a2u("Hello World!\n\r"));
return EFI_SUCCESS;
}
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
#include <efi.h>
#include <efilib.h>
extern EFI_GUID GraphicsOutputProtocol;
#define be32_to_cpu(x) __builtin_bswap32(x)
static void
fill_boxes(UINT32 *PixelBuffer, UINT32 Width, UINT32 Height, UINT32 Pitch,
EFI_GRAPHICS_PIXEL_FORMAT Format, EFI_PIXEL_BITMASK Info )
{
UINT32 Red, Green;
UINT32 y, x, color;
switch(Format) {
case PixelRedGreenBlueReserved8BitPerColor:
Red = be32_to_cpu(0xff000000);
Green = be32_to_cpu(0x00ff0000);
break;
case PixelBlueGreenRedReserved8BitPerColor:
Red = be32_to_cpu(0x0000ff00);
Green = be32_to_cpu(0x00ff0000);
break;
case PixelBitMask:
Red = Info.RedMask;
Green = Info.GreenMask;
break;
case PixelBltOnly:
return;
default:
Print(L"Invalid pixel format\n");
return;
}
for (y = 0; y < Height; y++) {
color = ((y / 32) % 2 == 0) ? Red : Green;
for (x = 0; x < Width; x++) {
if (x % 32 == 0 && x != 0)
color = (color == Red) ? Green : Red;
PixelBuffer[y * Pitch + x] = color;
}
}
}
static void
draw_boxes(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop)
{
int i, imax;
EFI_STATUS rc;
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *info;
UINTN NumPixels;
UINT32 *PixelBuffer;
UINT32 CopySize, BufferSize;
#if defined(__x86_64__) || defined(__aarch64__)
UINT64 FrameBufferAddr;
#elif defined(__i386__) || defined(__arm__)
UINT32 FrameBufferAddr;
#else
#error YOUR ARCH HERE
#endif
if (gop->Mode) {
imax = gop->Mode->MaxMode;
} else {
Print(L"gop->Mode is NULL\n");
return;
}
for (i = 0; i < imax; i++) {
UINTN SizeOfInfo;
rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i, &SizeOfInfo,
&info);
if (EFI_ERROR(rc) && rc == EFI_NOT_STARTED) {
Print(L"gop->QueryMode() returned %r\n", rc);
Print(L"Trying to start GOP with SetMode().\n");
rc = uefi_call_wrapper(gop->SetMode, 2, gop,
gop->Mode ? gop->Mode->Mode : 0);
rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i,
&SizeOfInfo, &info);
}
if (EFI_ERROR(rc)) {
Print(L"%d: Bad response from QueryMode: %r (%d)\n",
i, rc, rc);
continue;
}
if (CompareMem(info, gop->Mode->Info, sizeof (*info)))
continue;
NumPixels = info->VerticalResolution * info->PixelsPerScanLine;
BufferSize = NumPixels * sizeof(UINT32);
if (BufferSize == gop->Mode->FrameBufferSize) {
CopySize = BufferSize;
} else {
CopySize = BufferSize < gop->Mode->FrameBufferSize ?
BufferSize : gop->Mode->FrameBufferSize;
Print(L"height * pitch * pixelsize = %lu buf fb size is %lu; using %lu\n",
BufferSize, gop->Mode->FrameBufferSize, CopySize);
}
PixelBuffer = AllocatePool(BufferSize);
if (!PixelBuffer) {
Print(L"Allocation of 0x%08lx bytes failed.\n",
sizeof(UINT32) * NumPixels);
return;
}
fill_boxes(PixelBuffer, info->HorizontalResolution,
info->VerticalResolution, info->PixelsPerScanLine,
info->PixelFormat, info->PixelInformation);
if (info->PixelFormat == PixelBltOnly) {
Print(L"No linear framebuffer on this device.\n");
return;
}
#if defined(__x86_64__) || defined(__aarch64__)
FrameBufferAddr = (UINT64)gop->Mode->FrameBufferBase;
#elif defined(__i386__) || defined(__arm__)
FrameBufferAddr = (UINT32)(UINT64)gop->Mode->FrameBufferBase;
#else
#error YOUR ARCH HERE
#endif
CopyMem((VOID *)FrameBufferAddr, PixelBuffer, CopySize);
return;
}
Print(L"Never found the active video mode?\n");
}
static EFI_STATUS
SetWatchdog(UINTN seconds)
{
EFI_STATUS rc;
rc = uefi_call_wrapper(BS->SetWatchdogTimer, 4, seconds, 0x1ffff,
0, NULL);
if (EFI_ERROR(rc)) {
CHAR16 Buffer[64];
StatusToString(Buffer, rc);
Print(L"Bad response from QueryMode: %s (%d)\n", Buffer, rc);
}
return rc;
}
EFI_STATUS
efi_main (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *systab)
{
EFI_STATUS rc;
EFI_GRAPHICS_OUTPUT_PROTOCOL *gop;
InitializeLib(image_handle, systab);
SetWatchdog(10);
rc = LibLocateProtocol(&GraphicsOutputProtocol, (void **)&gop);
if (EFI_ERROR(rc)) {
Print(L"Could not locate GOP: %r\n", rc);
return rc;
}
if (!gop) {
Print(L"LocateProtocol(GOP, &gop) returned %r but GOP is NULL\n", rc);
return EFI_UNSUPPORTED;
}
draw_boxes(gop);
SetWatchdog(0);
return EFI_SUCCESS;
}
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
#include <efi.h>
#include <efilib.h>
EFI_STATUS
efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
{
SIMPLE_TEXT_OUTPUT_INTERFACE *conout;
InitializeLib(image, systab);
conout = systab->ConOut;
uefi_call_wrapper(conout->OutputString, 2, conout, L"Hello World!\n\r");
return EFI_SUCCESS;
}
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
#include <efi.h>
#include <efilib.h>
EFI_STATUS
efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
{
EFI_STATUS status;
CHAR16 name[256], *val, fmt[20];
EFI_GUID vendor;
UINTN size;
InitializeLib(image, systab);
name[0] = 0;
vendor = NullGuid;
Print(L"GUID Variable Name Value\n");
Print(L"=================================== ==================== ========\n");
StrCpy(fmt, L"%.-35g %.-20s %s\n");
while (1) {
size = sizeof(name);
status = uefi_call_wrapper(RT->GetNextVariableName, 3, &size, name, &vendor);
if (status != EFI_SUCCESS)
break;
val = LibGetVariable(name, &vendor);
Print(fmt, &vendor, name, val);
FreePool(val);
}
return EFI_SUCCESS;
}
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
#include <efi.h>
#include <efilib.h>
EFI_STATUS
GetVariableAttr(CHAR16 *var, UINT8 **data, UINTN *len, EFI_GUID owner,
UINT32 *attributes)
{
EFI_STATUS efi_status;
*len = 0;
efi_status = uefi_call_wrapper(RT->GetVariable, 5, var, &owner,
NULL, len, NULL);
if (efi_status != EFI_BUFFER_TOO_SMALL)
return efi_status;
*data = AllocateZeroPool(*len);
if (!*data)
return EFI_OUT_OF_RESOURCES;
efi_status = uefi_call_wrapper(RT->GetVariable, 5, var, &owner,
attributes, len, *data);
if (efi_status != EFI_SUCCESS) {
FreePool(*data);
*data = NULL;
}
return efi_status;
}
EFI_STATUS
GetVariable(CHAR16 *var, UINT8 **data, UINTN *len, EFI_GUID owner)
{
return GetVariableAttr(var, data, len, owner, NULL);
}
EFI_GUID DUMMY_GUID =
{0x55aad538, 0x8f82, 0x4e2a, {0xa4,0xf0,0xbe, 0x59, 0x13, 0xb6, 0x5f, 0x1e}};
#if defined(__clang__)
# define _OPTNONE __attribute__((optnone))
#else
# define _OPTNONE __attribute__((__optimize__("0")))
#endif
static _OPTNONE void
DebugHook(void)
{
EFI_GUID guid = DUMMY_GUID;
UINT8 *data = NULL;
UINTN dataSize = 0;
EFI_STATUS efi_status;
register volatile unsigned long long x = 0;
extern char _text, _data;
if (x)
return;
efi_status = GetVariable(L"DUMMY_DEBUG", &data, &dataSize, guid);
if (EFI_ERROR(efi_status)) {
return;
}
Print(L"add-symbol-file /usr/lib/debug/boot/efi/debughook.debug "
L"0x%08x -s .data 0x%08x\n", &_text, &_data);
Print(L"Pausing for debugger attachment.\n");
Print(L"To disable this, remove the EFI variable DUMMY_DEBUG-%g .\n",
&guid);
x = 1;
while (x++) {
/* Make this so it can't /totally/ DoS us. */
#if defined(__x86_64__) || defined(__i386__) || defined(__i686__)
if (x > 4294967294ULL)
break;
__asm__ __volatile__("pause");
#elif defined(__aarch64__)
if (x > 1000)
break;
__asm__ __volatile__("wfi");
#else
if (x > 12000)
break;
uefi_call_wrapper(BS->Stall, 1, 5000);
#endif
}
x = 1;
}
EFI_STATUS
efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
{
InitializeLib(image, systab);
DebugHook();
return EFI_SUCCESS;
}
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
#include <efi.h>
#include <efilib.h>
EFI_GUID GRUB_EFI_GRUB_VARIABLE_GUID = {0x91376aff,0xcba6,0x42be,{0x94,0x9d,0x06,0xfd,0xe8,0x11,0x28,0xe8}};
EFI_GUID SHIM_GUID = {0x605dab50,0xe046,0x4300,{0xab,0xb6,0x3d,0xd8,0x10,0xdd,0x8b,0x23}};
char grubenv[] = "# GRUB Environment Block\n\
debug=tcp,http,net\n\
####################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################";
EFI_STATUS
efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
{
EFI_STATUS status;
InitializeLib(image, systab);
#if 0
UINT8 data = 1;
status = RT->SetVariable(L"SHIM_DEBUG", &SHIM_GUID,
EFI_VARIABLE_NON_VOLATILE |
EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS,
sizeof(data), &data);
if (EFI_ERROR(status))
Print(L"SetVariable failed: %r\n", status);
#endif
status = RT->SetVariable(L"GRUB_ENV", &SHIM_GUID,
EFI_VARIABLE_NON_VOLATILE |
EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS,
sizeof(grubenv)-1, grubenv);
if (EFI_ERROR(status))
Print(L"SetVariable(GRUB_ENV) failed: %r\n", status);
return EFI_SUCCESS;
}
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
#include <efi.h>
#include <efilib.h>
typedef EFI_STATUS (*foo_t)(EFI_HANDLE, EFI_GUID *, VOID **);
typedef struct {
unsigned long addr;
unsigned long gp;
} fdesc_t;
EFI_LOADED_IMAGE my_loaded;
EFI_STATUS
efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
{
EFI_LOADED_IMAGE *loaded_image = NULL;
#if 0
EFI_DEVICE_PATH *dev_path;
#endif
EFI_STATUS status;
InitializeLib(image, systab);
status = uefi_call_wrapper(systab->BootServices->HandleProtocol,
3,
image,
&LoadedImageProtocol,
(void **) &loaded_image);
if (EFI_ERROR(status)) {
Print(L"handleprotocol: %r\n", status);
}
#if 0
BS->HandleProtocol(loaded_image->DeviceHandle, &DevicePathProtocol, (void **) &dev_path);
Print(L"Image device : %s\n", DevicePathToStr(dev_path));
Print(L"Image file : %s\n", DevicePathToStr(loaded_image->FilePath));
#endif
Print(L"Image base : %lx\n", loaded_image->ImageBase);
Print(L"Image size : %lx\n", loaded_image->ImageSize);
Print(L"Load options size : %lx\n", loaded_image->LoadOptionsSize);
Print(L"Load options : %s\n", loaded_image->LoadOptions);
return EFI_SUCCESS;
}
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
#include <efi.h>
#include <efilib.h>
EFI_STATUS
efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
{
Print(L"Press `q' to quit, any other key to continue:\n");
}
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
#include <efi.h>
#include <efilib.h>
#include <efisetjmp.h>
EFI_STATUS
efi_main(
EFI_HANDLE image_handle,
EFI_SYSTEM_TABLE *systab
)
{
jmp_buf env;
int rc;
InitializeLib(image_handle, systab);
rc = setjmp(env);
Print(L"setjmp() = %d\n", rc);
if (rc == 3) {
Print(L"3 worked\n");
longjmp(env, 0);
return 0;
}
if (rc == 1) {
Print(L"0 got to be one yay\n");
return 0;
}
longjmp(env, 3);
return 0;
}
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
#ifndef _GNU_EFI_APPS_DRV0_H_
#define _GNU_EFI_APPS_DRV0_H_
#ifdef __cplusplus
extern "C" {
#endif
/* UEFI naming conventions */
#define GNU_EFI_APPS_DRV0_PROTOCOL_GUID \
{ 0xe4dcafd0, 0x586c, 0x4b3d, {0x86, 0xe7, 0x28, 0xde, 0x7f, 0xcc, 0x04, 0xb9} }
INTERFACE_DECL(_GNU_EFI_APPS_DRV0_PROTOCOL);
typedef
EFI_STATUS
(EFIAPI *GNU_EFI_APPS_DRV0_SAY_HELLO) (
IN const CHAR16 *HelloWho
);
typedef
EFI_STATUS
(EFIAPI *GNU_EFI_APPS_DRV0_GET_NUMBER_OF_HELLO) (
OUT UINTN *NumberOfHello
);
typedef struct _GNU_EFI_APPS_DRV0_PROTOCOL {
GNU_EFI_APPS_DRV0_SAY_HELLO SayHello;
GNU_EFI_APPS_DRV0_GET_NUMBER_OF_HELLO GetNumberOfHello;
} GNU_EFI_APPS_DRV0_PROTOCOL;
#ifdef __cplusplus
}
#endif
#endif
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
#include <efi.h>
#include <efilib.h>
EFI_STATUS
efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
{
InitializeLib(image, systab);
Print(L"HelloLib application started\n");
Print(L"\n\n\nHit any key to exit this image\n");
WaitForSingleEvent(ST->ConIn->WaitForKey, 0);
uefi_call_wrapper(ST->ConOut->OutputString, 2, ST->ConOut, L"\n\n");
return EFI_SUCCESS;
}
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
#
# Copyright (C) 1999-2001 Hewlett-Packard Co.
# Contributed by David Mosberger <[email protected]>
# Contributed by Stephane Eranian <[email protected]>
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials
# provided with the distribution.
# * Neither the name of Hewlett-Packard Co. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANYDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
SRCDIR = .
VPATH = $(SRCDIR)
include $(SRCDIR)/../Make.defaults
TOPDIR = $(SRCDIR)/..
CDIR=$(TOPDIR)/..
LINUX_HEADERS = /usr/src/sys/build
CPPFLAGS += -D__KERNEL__ -I$(LINUX_HEADERS)/include
CRTOBJS = ../gnuefi/crt0-efi-$(ARCH).o
LDSCRIPT = $(TOPDIR)/gnuefi/elf_$(ARCH)_efi.lds
ifneq (,$(findstring FreeBSD,$(OS)))
LDSCRIPT = $(TOPDIR)/gnuefi/elf_$(ARCH)_fbsd_efi.lds
endif
LDFLAGS += -shared -Bsymbolic -L../lib -L../gnuefi $(CRTOBJS)
LOADLIBES += -lefi -lgnuefi
LOADLIBES += $(LIBGCC)
LOADLIBES += -T $(LDSCRIPT)
TARGET_APPS = t.efi t2.efi t3.efi t4.efi t5.efi t6.efi \
printenv.efi t7.efi t8.efi tcc.efi modelist.efi \
route80h.efi drv0_use.efi AllocPages.efi exit.efi \
FreePages.efi setjmp.efi debughook.efi debughook.efi.debug \
bltgrid.efi lfbgrid.efi setdbg.efi unsetdbg.efi
TARGET_BSDRIVERS = drv0.efi
TARGET_RTDRIVERS =
ifneq ($(HAVE_EFI_OBJCOPY),)
FORMAT := --target efi-app-$(ARCH)
$(TARGET_BSDRIVERS): FORMAT=--target efi-bsdrv-$(ARCH)
$(TARGET_RTDRIVERS): FORMAT=--target efi-rtdrv-$(ARCH)
else
SUBSYSTEM := 0xa
$(TARGET_BSDRIVERS): SUBSYSTEM = 0xb
$(TARGET_RTDRIVERS): SUBSYSTEM = 0xc
FORMAT := -O binary
LDFLAGS += --defsym=EFI_SUBSYSTEM=$(SUBSYSTEM)
endif
TARGETS = $(TARGET_APPS) $(TARGET_BSDRIVERS) $(TARGET_RTDRIVERS)
all: $(TARGETS)
clean:
rm -f $(TARGETS) *~ *.o *.so
.PHONY: install
include $(SRCDIR)/../Make.rules
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
#include <efi.h>
#include <efilib.h>
EFI_STATUS
efi_main(
EFI_HANDLE image_handle,
EFI_SYSTEM_TABLE *systab
)
{
EFI_GUID loaded_image_protocol = LOADED_IMAGE_PROTOCOL;
EFI_STATUS efi_status;
EFI_LOADED_IMAGE *li;
UINTN pat = PoolAllocationType;
VOID *void_li_p;
InitializeLib(image_handle, systab);
PoolAllocationType = 2; /* klooj */
Print(L"Hello World! (0xd=0x%x, 13=%d)\n", 13, 13);
Print(L"before InitializeLib(): PoolAllocationType=%d\n",
pat);
Print(L" after InitializeLib(): PoolAllocationType=%d\n",
PoolAllocationType);
/*
* Locate loaded_image_handle instance.
*/
Print(L"BS->HandleProtocol() ");
efi_status = uefi_call_wrapper(
BS->HandleProtocol,
3,
image_handle,
&loaded_image_protocol,
&void_li_p);
li = void_li_p;
Print(L"%xh (%r)\n", efi_status, efi_status);
if (efi_status != EFI_SUCCESS) {
return efi_status;
}
Print(L" li: %xh\n", li);
if (!li) {
return EFI_UNSUPPORTED;
}
Print(L" li->Revision: %xh\n", li->Revision);
Print(L" li->ParentHandle: %xh\n", li->ParentHandle);
Print(L" li->SystemTable: %xh\n", li->SystemTable);
Print(L" li->DeviceHandle: %xh\n", li->DeviceHandle);
Print(L" li->FilePath: %xh\n", li->FilePath);
Print(L" li->Reserved: %xh\n", li->Reserved);
Print(L" li->LoadOptionsSize: %xh\n", li->LoadOptionsSize);
Print(L" li->LoadOptions: %xh\n", li->LoadOptions);
Print(L" li->ImageBase: %xh\n", li->ImageBase);
Print(L" li->ImageSize: %xh\n", li->ImageSize);
Print(L" li->ImageCodeType: %xh\n", li->ImageCodeType);
Print(L" li->ImageDataType: %xh\n", li->ImageDataType);
Print(L" li->Unload: %xh\n", li->Unload);
#if 0
typedef struct {
UINT32 Revision;
EFI_HANDLE ParentHandle;
struct _EFI_SYSTEM_TABLE *SystemTable;
// Source location of image
EFI_HANDLE DeviceHandle;
EFI_DEVICE_PATH *FilePath;
VOID *Reserved;
// Images load options
UINT32 LoadOptionsSize;
VOID *LoadOptions;
// Location of where image was loaded
VOID *ImageBase;
UINT64 ImageSize;
EFI_MEMORY_TYPE ImageCodeType;
EFI_MEMORY_TYPE ImageDataType;
// If the driver image supports a dynamic unload request
EFI_IMAGE_UNLOAD Unload;
} EFI_LOADED_IMAGE;
#endif
return EFI_SUCCESS;
}
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
#include <efi.h>
#include <efilib.h>
EFI_GUID GRUB_EFI_GRUB_VARIABLE_GUID = {0x91376aff,0xcba6,0x42be,{0x94,0x9d,0x06,0xfd,0xe8,0x11,0x28,0xe8}};
EFI_GUID SHIM_GUID = {0x605dab50,0xe046,0x4300,{0xab,0xb6,0x3d,0xd8,0x10,0xdd,0x8b,0x23}};
char grubenv[] = "# GRUB Environment Block\n\
debug=all\n\
#############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################";
EFI_STATUS
efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
{
EFI_STATUS status;
UINT8 data = 1;
InitializeLib(image, systab);
status = RT->SetVariable(L"SHIM_DEBUG", &SHIM_GUID,
EFI_VARIABLE_NON_VOLATILE |
EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS,
0, &data);
if (EFI_ERROR(status))
Print(L"SetVariable failed: %r\n", status);
#if 0
status = RT->SetVariable(L"GRUB_ENV", &SHIM_GUID,
EFI_VARIABLE_NON_VOLATILE |
EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS,
sizeof(grubenv)-1, grubenv);
if (EFI_ERROR(status))
Print(L"SetVariable(GRUB_ENV) failed: %r\n", status);
#endif
return EFI_SUCCESS;
}
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
#include <efi.h>
#include <efilib.h>
EFI_STATUS
efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
{
EFI_INPUT_KEY efi_input_key;
EFI_STATUS efi_status;
InitializeLib(image, systab);
Print(L"HelloLib application started\n");
Print(L"\n\n\nHit any key to exit this image\n");
WaitForSingleEvent(ST->ConIn->WaitForKey, 0);
uefi_call_wrapper(ST->ConOut->OutputString, 2, ST->ConOut, L"\n\n");
efi_status = uefi_call_wrapper(ST->ConIn->ReadKeyStroke, 2, ST->ConIn, &efi_input_key);
Print(L"ScanCode: %xh UnicodeChar: %xh CallRtStatus: %x\n",
efi_input_key.ScanCode, efi_input_key.UnicodeChar, efi_status);
return EFI_SUCCESS;
}
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
/*
* Test if our calling convention gymnastics actually work
*/
#include <efi.h>
#include <efilib.h>
#if 0
extern void dump_stack(void);
asm( ".globl dump_stack\n"
"dump_stack:\n"
" movq %rsp, %rdi\n"
" jmp *dump_stack_helper@GOTPCREL(%rip)\n"
".size dump_stack, .-dump_stack");
void dump_stack_helper(uint64_t rsp_val)
{
uint64_t *rsp = (uint64_t *)rsp_val;
int x;
Print(L"%%rsp: 0x%08x%08x stack:\r\n",
(rsp_val & 0xffffffff00000000) >>32,
rsp_val & 0xffffffff);
for (x = 0; x < 8; x++) {
Print(L"%08x: ", ((uint64_t)rsp) & 0xffffffff);
Print(L"%016x ", *rsp++);
Print(L"%016x ", *rsp++);
Print(L"%016x ", *rsp++);
Print(L"%016x\r\n", *rsp++);
}
}
#endif
EFI_STATUS EFI_FUNCTION test_failure_callback(void)
{
return EFI_UNSUPPORTED;
}
EFI_STATUS test_failure(void)
{
return uefi_call_wrapper(test_failure_callback, 0);
}
EFI_STATUS EFI_FUNCTION test_call0_callback(void)
{
return EFI_SUCCESS;
}
EFI_STATUS test_call0(void)
{
return uefi_call_wrapper(test_call0_callback, 0);
}
EFI_STATUS EFI_FUNCTION test_call1_callback(UINT32 a)
{
if (a != 0x12345678) {
return EFI_LOAD_ERROR;
}
return EFI_SUCCESS;
}
EFI_STATUS test_call1(void)
{
return uefi_call_wrapper(test_call1_callback, 1,0x12345678);
}
EFI_STATUS EFI_FUNCTION test_call2_callback(UINT32 a, UINT32 b)
{
if (a != 0x12345678) {
return EFI_LOAD_ERROR;
}
if (b != 0x23456789) {
return EFI_INVALID_PARAMETER;
}
return EFI_SUCCESS;
}
EFI_STATUS test_call2(void)
{
return uefi_call_wrapper(test_call2_callback, 2,
0x12345678, 0x23456789);
}
EFI_STATUS EFI_FUNCTION test_call3_callback(UINT32 a, UINT32 b,
UINT32 c)
{
if (a != 0x12345678)
return EFI_LOAD_ERROR;
if (b != 0x23456789)
return EFI_INVALID_PARAMETER;
if (c != 0x3456789a)
return EFI_UNSUPPORTED;
return EFI_SUCCESS;
}
EFI_STATUS test_call3(void)
{
return uefi_call_wrapper(test_call3_callback, 3,
0x12345678, 0x23456789, 0x3456789a);
}
EFI_STATUS EFI_FUNCTION test_call4_callback(UINT32 a, UINT32 b,
UINT32 c, UINT32 d)
{
if (a != 0x12345678)
return EFI_LOAD_ERROR;
if (b != 0x23456789)
return EFI_INVALID_PARAMETER;
if (c != 0x3456789a)
return EFI_UNSUPPORTED;
if (d != 0x456789ab)
return EFI_BAD_BUFFER_SIZE;
return EFI_SUCCESS;
}
EFI_STATUS test_call4(void)
{
return uefi_call_wrapper(test_call4_callback, 4,
0x12345678, 0x23456789, 0x3456789a, 0x456789ab);
}
EFI_STATUS EFI_FUNCTION test_call5_callback(UINT32 a, UINT32 b,
UINT32 c, UINT32 d, UINT32 e)
{
if (a != 0x12345678)
return EFI_LOAD_ERROR;
if (b != 0x23456789)
return EFI_INVALID_PARAMETER;
if (c != 0x3456789a)
return EFI_UNSUPPORTED;
if (d != 0x456789ab)
return EFI_BAD_BUFFER_SIZE;
if (e != 0x56789abc)
return EFI_BUFFER_TOO_SMALL;
return EFI_SUCCESS;
}
EFI_STATUS test_call5(void)
{
return uefi_call_wrapper(test_call5_callback, 5,
0x12345678, 0x23456789, 0x3456789a, 0x456789ab, 0x56789abc);
}
EFI_STATUS EFI_FUNCTION test_call6_callback(UINT32 a, UINT32 b,
UINT32 c, UINT32 d, UINT32 e, UINT32 f)
{
if (a != 0x12345678)
return EFI_LOAD_ERROR;
if (b != 0x23456789)
return EFI_INVALID_PARAMETER;
if (c != 0x3456789a)
return EFI_UNSUPPORTED;
if (d != 0x456789ab)
return EFI_BAD_BUFFER_SIZE;
if (e != 0x56789abc)
return EFI_BUFFER_TOO_SMALL;
if (f != 0x6789abcd)
return EFI_NOT_READY;
return EFI_SUCCESS;
}
EFI_STATUS test_call6(void)
{
return uefi_call_wrapper(test_call6_callback, 6,
0x12345678, 0x23456789, 0x3456789a, 0x456789ab, 0x56789abc,
0x6789abcd);
}
EFI_STATUS EFI_FUNCTION test_call7_callback(UINT32 a, UINT32 b,
UINT32 c, UINT32 d, UINT32 e, UINT32 f, UINT32 g)
{
if (a != 0x12345678)
return EFI_LOAD_ERROR;
if (b != 0x23456789)
return EFI_INVALID_PARAMETER;
if (c != 0x3456789a)
return EFI_UNSUPPORTED;
if (d != 0x456789ab)
return EFI_BAD_BUFFER_SIZE;
if (e != 0x56789abc)
return EFI_BUFFER_TOO_SMALL;
if (f != 0x6789abcd)
return EFI_NOT_READY;
if (g != 0x789abcde)
return EFI_DEVICE_ERROR;
return EFI_SUCCESS;
}
EFI_STATUS test_call7(void)
{
return uefi_call_wrapper(test_call7_callback, 7,
0x12345678, 0x23456789, 0x3456789a, 0x456789ab,
0x56789abc, 0x6789abcd, 0x789abcde);
}
EFI_STATUS EFI_FUNCTION test_call8_callback(UINT32 a, UINT32 b,
UINT32 c, UINT32 d, UINT32 e, UINT32 f, UINT32 g, UINT32 h)
{
if (a != 0x12345678)
return EFI_LOAD_ERROR;
if (b != 0x23456789)
return EFI_INVALID_PARAMETER;
if (c != 0x3456789a)
return EFI_UNSUPPORTED;
if (d != 0x456789ab)
return EFI_BAD_BUFFER_SIZE;
if (e != 0x56789abc)
return EFI_BUFFER_TOO_SMALL;
if (f != 0x6789abcd)
return EFI_NOT_READY;
if (g != 0x789abcde)
return EFI_DEVICE_ERROR;
if (h != 0x89abcdef)
return EFI_WRITE_PROTECTED;
return EFI_SUCCESS;
}
EFI_STATUS test_call8(void)
{
return uefi_call_wrapper(test_call8_callback, 8,
0x12345678,
0x23456789,
0x3456789a,
0x456789ab,
0x56789abc,
0x6789abcd,
0x789abcde,
0x89abcdef);
}
EFI_STATUS EFI_FUNCTION test_call9_callback(UINT32 a, UINT32 b,
UINT32 c, UINT32 d, UINT32 e, UINT32 f, UINT32 g, UINT32 h, UINT32 i)
{
if (a != 0x12345678)
return EFI_LOAD_ERROR;
if (b != 0x23456789)
return EFI_INVALID_PARAMETER;
if (c != 0x3456789a)
return EFI_UNSUPPORTED;
if (d != 0x456789ab)
return EFI_BAD_BUFFER_SIZE;
if (e != 0x56789abc)
return EFI_BUFFER_TOO_SMALL;
if (f != 0x6789abcd)
return EFI_NOT_READY;
if (g != 0x789abcde)
return EFI_DEVICE_ERROR;
if (h != 0x89abcdef)
return EFI_WRITE_PROTECTED;
if (i != 0x9abcdef0)
return EFI_OUT_OF_RESOURCES;
return EFI_SUCCESS;
}
EFI_STATUS test_call9(void)
{
return uefi_call_wrapper(test_call9_callback, 9,
0x12345678,
0x23456789,
0x3456789a,
0x456789ab,
0x56789abc,
0x6789abcd,
0x789abcde,
0x89abcdef,
0x9abcdef0);
}
extern EFI_STATUS test_call10(void);
EFI_STATUS EFI_FUNCTION test_call10_callback(UINT32 a, UINT32 b,
UINT32 c, UINT32 d, UINT32 e, UINT32 f, UINT32 g, UINT32 h, UINT32 i,
UINT32 j)
{
if (a != 0x12345678)
return EFI_LOAD_ERROR;
if (b != 0x23456789)
return EFI_INVALID_PARAMETER;
if (c != 0x3456789a)
return EFI_UNSUPPORTED;
if (d != 0x456789ab)
return EFI_BAD_BUFFER_SIZE;
if (e != 0x56789abc)
return EFI_BUFFER_TOO_SMALL;
if (f != 0x6789abcd)
return EFI_NOT_READY;
if (g != 0x789abcde)
return EFI_DEVICE_ERROR;
if (h != 0x89abcdef)
return EFI_WRITE_PROTECTED;
if (i != 0x9abcdef0)
return EFI_OUT_OF_RESOURCES;
if (j != 0xabcdef01)
return EFI_VOLUME_CORRUPTED;
return EFI_SUCCESS;
}
EFI_STATUS test_call10(void)
{
return uefi_call_wrapper(test_call10_callback, 10,
0x12345678,
0x23456789,
0x3456789a,
0x456789ab,
0x56789abc,
0x6789abcd,
0x789abcde,
0x89abcdef,
0x9abcdef0,
0xabcdef01);
}
EFI_STATUS
efi_main (EFI_HANDLE *image, EFI_SYSTEM_TABLE *systab)
{
EFI_STATUS rc = EFI_SUCCESS;
InitializeLib(image, systab);
PoolAllocationType = 2; /* klooj */
#ifdef __x86_64__
__asm__ volatile("out %0,%1" : : "a" ((uint8_t)0x14), "dN" (0x80));
#endif
Print(L"Hello\r\n");
rc = test_failure();
if (EFI_ERROR(rc)) {
Print(L"Returning Failure works\n");
} else {
Print(L"Returning failure doesn't work.\r\n");
Print(L"%%rax was 0x%016x, should have been 0x%016x\n",
rc, EFI_UNSUPPORTED);
return EFI_INVALID_PARAMETER;
}
rc = test_call0();
if (!EFI_ERROR(rc)) {
Print(L"0 args works just fine here.\r\n");
} else {
Print(L"0 args failed: 0x%016x\n", rc);
return rc;
}
rc = test_call1();
if (!EFI_ERROR(rc)) {
Print(L"1 arg works just fine here.\r\n");
} else {
Print(L"1 arg failed: 0x%016x\n", rc);
return rc;
}
rc = test_call2();
if (!EFI_ERROR(rc)) {
Print(L"2 args works just fine here.\r\n");
} else {
Print(L"2 args failed: 0x%016x\n", rc);
return rc;
}
rc = test_call3();
if (!EFI_ERROR(rc)) {
Print(L"3 args works just fine here.\r\n");
} else {
Print(L"3 args failed: 0x%016x\n", rc);
return rc;
}
rc = test_call4();
if (!EFI_ERROR(rc)) {
Print(L"4 args works just fine here.\r\n");
} else {
Print(L"4 args failed: 0x%016x\n", rc);
return rc;
}
rc = test_call5();
if (!EFI_ERROR(rc)) {
Print(L"5 args works just fine here.\r\n");
} else {
Print(L"5 args failed: 0x%016x\n", rc);
return rc;
}
rc = test_call6();
if (!EFI_ERROR(rc)) {
Print(L"6 args works just fine here.\r\n");
} else {
Print(L"6 args failed: 0x%016x\n", rc);
return rc;
}
rc = test_call7();
if (!EFI_ERROR(rc)) {
Print(L"7 args works just fine here.\r\n");
} else {
Print(L"7 args failed: 0x%016x\n", rc);
return rc;
}
rc = test_call8();
if (!EFI_ERROR(rc)) {
Print(L"8 args works just fine here.\r\n");
} else {
Print(L"8 args failed: 0x%016x\n", rc);
return rc;
}
rc = test_call9();
if (!EFI_ERROR(rc)) {
Print(L"9 args works just fine here.\r\n");
} else {
Print(L"9 args failed: 0x%016x\n", rc);
return rc;
}
rc = test_call10();
if (!EFI_ERROR(rc)) {
Print(L"10 args works just fine here.\r\n");
} else {
Print(L"10 args failed: 0x%016x\n", rc);
return rc;
}
return rc;
}
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
/*
* Copyright (C) 2013 David Decotigny <[email protected]>
*
* See drv0.c for an example session.
*/
#include <efi.h>
#include <efilib.h>
#include "drv0.h"
static EFI_GUID GnuEfiAppsDrv0ProtocolGuid
= GNU_EFI_APPS_DRV0_PROTOCOL_GUID;
static
EFI_STATUS
PlayWithGnuEfiAppsDrv0Protocol(IN EFI_HANDLE DrvHandle) {
EFI_STATUS Status;
GNU_EFI_APPS_DRV0_PROTOCOL *drv = NULL;
UINTN NumberOfHello = 0;
Status = uefi_call_wrapper(BS->OpenProtocol, 6,
DrvHandle,
&GnuEfiAppsDrv0ProtocolGuid,
(void**)&drv,
DrvHandle,
NULL,
EFI_OPEN_PROTOCOL_GET_PROTOCOL);
if (EFI_ERROR(Status)) {
Print(L"Cannot open proto: %d\n", Status);
return Status;
}
Status = uefi_call_wrapper(drv->SayHello, 2, L"Sample UEFI Driver");
if (EFI_ERROR(Status)) {
Print(L"Cannot call SayHello: %d\n", Status);
}
Status = uefi_call_wrapper(drv->GetNumberOfHello, 2, &NumberOfHello);
if (EFI_ERROR(Status)) {
Print(L"Cannot call GetNumberOfHello: %d\n", Status);
} else {
Print(L"Hello was called %d time(s).\n", NumberOfHello);
}
return EFI_SUCCESS;
}
EFI_STATUS
efi_main (EFI_HANDLE Image, EFI_SYSTEM_TABLE *SysTab)
{
EFI_STATUS Status;
EFI_HANDLE *Handles = NULL;
UINTN i, NoHandles = 0;
InitializeLib(Image, SysTab);
Status = LibLocateHandle(ByProtocol, &GnuEfiAppsDrv0ProtocolGuid,
NULL, &NoHandles, &Handles);
if (EFI_ERROR(Status)) {
Print(L"Error looking up handles for proto: %d\n", Status);
return Status;
}
for (i = 0 ; i < NoHandles ; ++i)
{
Print(L"Playing with driver instance %d...\n", i);
Status = PlayWithGnuEfiAppsDrv0Protocol(Handles[i]);
if (EFI_ERROR(Status))
Print(L"Error playing with instance %d, skipping\n", i);
}
if (Handles)
FreePool(Handles);
return EFI_SUCCESS;
}
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
set OSNAME=CustomOS
set BUILDDIR=%0/../bin
set OVMFDIR=%0/../../OVMFbin
qemu-system-x86_64 -drive file=%BUILDDIR%/%OSNAME%.img -m 256M -cpu qemu64 -drive if=pflash,format=raw,unit=0,file="%OVMFDIR%/OVMF_CODE-pure-efi.fd",readonly=on -drive if=pflash,format=raw,unit=1,file="%OVMFDIR%/OVMF_VARS-pure-efi.fd" -net none
pause
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
@echo -off
mode 80 25
cls
if exist .\efi\boot\main.efi then
.\efi\boot\main.efi
goto END
endif
if exist fs0:\efi\boot\main.efi then
fs0:
echo Found bootloader on fs0:
efi\boot\main.efi
goto END
endif
if exist fs1:\efi\boot\main.efi then
fs1:
echo Found bootloader on fs1:
efi\boot\main.efi
goto END
endif
if exist fs2:\efi\boot\main.efi then
fs2:
echo Found bootloader on fs2:
efi\boot\main.efi
goto END
endif
if exist fs3:\efi\boot\main.efi then
fs3:
echo Found bootloader on fs3:
efi\boot\main.efi
goto END
endif
if exist fs4:\efi\boot\main.efi then
fs4:
echo Found bootloader on fs4:
efi\boot\main.efi
goto END
endif
if exist fs5:\efi\boot\main.efi then
fs5:
echo Found bootloader on fs5:
efi\boot\main.efi
goto END
endif
if exist fs6:\efi\boot\main.efi then
fs6:
echo Found bootloader on fs6:
efi\boot\main.efi
goto END
endif
if exist fs7:\efi\boot\main.efi then
fs7:
echo Found bootloader on fs7:
efi\boot\main.efi
goto END
endif
echo "Unable to find bootloader".
:END
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
OUTPUT_FORMAT(elf64-x86-64)
ENTRY(_start)
SECTIONS
{
.text : ALIGN(0x1000)
{
*(.text)
}
.data : ALIGN(0x1000)
{
*(.data)
}
.rodata : ALIGN(0x1000)
{
*(.rodata)
}
.bss : ALIGN(0x1000)
{
*(COMMON)
*(.bss)
}
} | {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
set OSNAME=CustomOS
set BUILDDIR=%0/../bin
set OVMFDIR=%0/../../OVMFbin
set BUILDDIR=%BUILDDIR:"=%
set OVMFDIR=%OVMFDIR:"=%
qemu-system-x86_64 -drive file=%BUILDDIR%/%OSNAME%.img -m 256M -cpu qemu64 -drive if=pflash,format=raw,unit=0,file=%OVMFDIR%/OVMF_CODE-pure-efi.fd,readonly=on -drive if=pflash,format=raw,unit=1,file=%OVMFDIR%/OVMF_VARS-pure-efi.fd -net none
pause
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
OSNAME = CustomOS
GNUEFI = ../gnu-efi
OVMFDIR = ../OVMFbin
LDS = kernel.ld
CC = gcc
LD = ld
CFLAGS = -ffreestanding -fshort-wchar
LDFLAGS = -T $(LDS) -static -Bsymbolic -nostdlib
SRCDIR := src
OBJDIR := lib
BUILDDIR = bin
BOOTEFI := $(GNUEFI)/x86_64/bootloader/main.efi
rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))
SRC = $(call rwildcard,$(SRCDIR),*.c)
OBJS = $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(SRC))
DIRS = $(wildcard $(SRCDIR)/*)
kernel: $(OBJS) link
$(OBJDIR)/%.o: $(SRCDIR)/%.c
@ echo !==== COMPILING $^
@ mkdir -p $(@D)
$(CC) $(CFLAGS) -c $^ -o $@
link:
@ echo !==== LINKING
$(LD) $(LDFLAGS) -o $(BUILDDIR)/kernel.elf $(OBJS)
setup:
@mkdir $(BUILDDIR)
@mkdir $(SRCDIR)
@mkdir $(OBJDIR)
buildimg:
dd if=/dev/zero of=$(BUILDDIR)/$(OSNAME).img bs=512 count=93750
mformat -i $(BUILDDIR)/$(OSNAME).img -f 1440 ::
mmd -i $(BUILDDIR)/$(OSNAME).img ::/EFI
mmd -i $(BUILDDIR)/$(OSNAME).img ::/EFI/BOOT
mcopy -i $(BUILDDIR)/$(OSNAME).img $(BOOTEFI) ::/EFI/BOOT
mcopy -i $(BUILDDIR)/$(OSNAME).img startup.nsh ::
mcopy -i $(BUILDDIR)/$(OSNAME).img $(BUILDDIR)/kernel.elf ::
run:
qemu-system-x86_64 -drive file=$(BUILDDIR)/$(OSNAME).img -m 256M -cpu qemu64 -drive if=pflash,format=raw,unit=0,file="$(OVMFDIR)/OVMF_CODE-pure-efi.fd",readonly=on -drive if=pflash,format=raw,unit=1,file="$(OVMFDIR)/OVMF_VARS-pure-efi.fd" -net none
| {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
int _start(){
return 123;
} | {
"repo_name": "Absurdponcho/PonchoOS",
"stars": "151",
"repo_language": "C",
"file_name": "kernel.c",
"mime_type": "text/plain"
} |
---
layout: null
---
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ site.title | xml_escape }}</title>
<description>{{ site.description | xml_escape }}</description>
<link>{{ site.url }}{{ site.baseurl }}/</link>
<atom:link href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" rel="self" type="application/rss+xml"/>
<pubDate>{{ site.time | date_to_rfc822 }}</pubDate>
<lastBuildDate>{{ site.time | date_to_rfc822 }}</lastBuildDate>
<generator>Jekyll v{{ jekyll.version }}</generator>
{% for post in site.recipes limit:10 %}
<item>
<title>{{ post.title | xml_escape }}</title>
<description>{{ post.content | xml_escape }}</description>
<link>{{ post.url | prepend: site.baseurl | prepend: site.url }}</link>
<guid isPermaLink="true">{{ post.url | prepend: site.baseurl | prepend: site.url }}</guid>
{% for tag in post.tags %}
<category>{{ tag | xml_escape }}</category>
{% endfor %}
{% for cat in post.categories %}
<category>{{ cat | xml_escape }}</category>
{% endfor %}
</item>
{% endfor %}
</channel>
</rss>
| {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: null
---
{% assign counter = 1 %}
{% assign total = site.recipes | size %}
[{% for post in site.recipes %}
{
"title": "{{ post.title }}",
"image": "{{ site.baseurl }}/images/{{ post.image }}"
}{% if counter == total %}{% else %},{% endif %}
{% assign counter = counter |plus: 1 %}{% endfor %}] | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
# Site settings
title: Chowdown
email: [email protected]
description: The plain text recipe database for hackers
baseurl: "https://chowdown.io"
language: "en"
lang_direction: "ltr"
color: "#007FFF"
twitter_username: clarklab
github_username: clarklab
# Build settings
markdown: kramdown
permalink: /:title:output_ext
collections:
components:
output: true
recipes:
output: true
exclude: ['Gemfile', 'Gemfile.lock', 'Rakefile', 'README.md']
translation:
en:
components: "Components"
ingredients: "Ingredients"
directions: "Directions"
category: "Category"
nutritional_information: "Nutritional Information"
component_based: 'This is a <strong class="blue">component-based recipe</strong>.'
search: "Search"
blog: "Blog"
subscribe: "Subscribe"
de:
components: "Komponenten"
ingredients: "Zutaten"
directions: "Zubereitung"
category: "Kategorie"
nutritional_information: "Nährwertangaben"
component_based: 'Dieses Rezept besteht aus <strong class="blue">mehreren Komponenten</strong>.'
search: "Suche"
blog: "Blog"
subscribe: "Abonnieren" | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
User-agent: Twitterbot
Disallow: | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
const CACHE = "pwabuilder-offline";
const offlineFallbackPage = "index.html";
// Install stage sets up the index page (home page) in the cache and opens a new cache
self.addEventListener("install", function (event) {
console.log("Install Event processing");
event.waitUntil(
caches.open(CACHE).then(function (cache) {
console.log("Cached offline page during install");
if (offlineFallbackPage === "ToDo-replace-this-name.html") {
return cache.add(new Response("Update the value of the offlineFallbackPage constant in the serviceworker."));
}
return cache.add(offlineFallbackPage);
})
);
});
// If any fetch fails, it will look for the request in the cache and serve it from there first
self.addEventListener("fetch", function (event) {
if (event.request.method !== "GET") return;
event.respondWith(
fetch(event.request)
.then(function (response) {
console.log("Add page to offline cache: " + response.url);
// If request was success, add or update it in the cache
event.waitUntil(updateCache(event.request, response.clone()));
return response;
})
.catch(function (error) {
console.log("Network request Failed. Serving content from cache: " + error);
return fromCache(event.request);
})
);
});
function fromCache(request) {
// Check to see if you have it in the cache
// Return response
// If not in the cache, then return error page
return caches.open(CACHE).then(function (cache) {
return cache.match(request).then(function (matching) {
if (!matching || matching.status === 404) {
return Promise.reject("no-match");
}
return matching;
});
});
}
function updateCache(request, response) {
return caches.open(CACHE).then(function (cache) {
return cache.put(request, response);
});
} | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: none
---
{
"name": "{{ site.title }}",
"short_name": "{{ site.title }}",
"icons": [
{
"src": "/icons/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "/icons/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
],
"theme_color": "{{ site.color }}",
"background_color": "{{ site.color }}",
"start_url": "https://chowdown.io",
"display": "standalone"
}
| {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
# Chowdown
A simple, plaintext recipe database for hackers
[http://chowdown.io](http://chowdown.io)
# Getting Started
This is a Jekyll build. Make sure you have Jekyll [installed](https://jekyllrb.com/). To install, run this command in the terminal (or iTerm, etc):
```gem install bundler jekyll```
or to check if you've got it installed already:
```jekyll -v```
Clone or download this repo. Navigate to the folder in terminal (or iTerm, etc), and then run:
```jekyll serve```
With default settings, you should be able to view the site locally at `http://127.0.0.1:4000/`
# Writing a Recipe
The recipes are stored in the collection "Recipes" (the folder /_recipes).
They are written in Markdown and contain a few special sections:
- The frontmatter, which contains:
- Title, Image, and Layout (which is "recipe")
- Ingredients (a list of things in the dish)
- Directions (a list of steps for the dish)
- Body content (for intros, stories, written detail)
If you need help with Markdown, here's a [handy cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet).
# Writing a component recipe
A component recipe is a special recipe made up of other recipes. To make a new component recipe:
- place your smaller, single recipes into the /_components folder
- make a new recipe like normal in the /_recipes folders
- in the frontmatter of this new recipe, include your recipes from the /_components folder (instead of the usual Ingredeints list)
You can an example on the Red Berry Tart recipe.
- [example Markdown](https://raw.githubusercontent.com/clarklab/chowdown/gh-pages/_recipes/red-berry-tart.md)
- [example recipe page](http://chowdown.io/recipes/red-berry-tart.html) | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: page
title: About
permalink: /about/
---
Chowdown, a plain text recipe database for hackers | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: default
---
<div class="home">
<div class="recipes xs-px1 xs-mt2">
<div class="clearfix">
{% assign sorted = site.recipes | sort:"date" %}
{% for post in sorted %}
<div class="sm-col sm-col-6 md-col-6 lg-col-4 xs-px1 xs-mb2">
<a class="block relative bg-blue" href="{{ post.url | prepend: site.baseurl }}">
<div class="image ratio bg-cover"{% for image in post.image %} style="background-image:url({{site.baseurl}}/images/{{ image }});"{% endfor %}></div>
<h1 class="title p2 m0 absolute bold white bottom-0 left-0">{{ post.title }}</h1>
</a>
</div>
{% endfor %}
</div>
</div>
<div class="sell bg-blue-tile mt4">
<div class="clearfix white px2">
<div class="sm-col md-col-6 px2 md-px4 py2 md-py4">
<h1>For the home chef</h1>
<p>Save recipes in seconds with plain text formatting</p>
<p>Create beatiful recipe pages with automated ease</p>
<p>Use your recipes in any app (our favorite is <a href="http://www.paprikaapp.com/" target="_blank">Paprika</a>)</p>
<p>Share with family and friends (<a href="https://dev.twitter.com/cards/overview">Twitter cards</a>)</p>
</div>
<div class="sm-col md-col-6 px2 md-px4 py2 md-py4">
<h1>For the developer</h1>
<p>Markdown + Jekyll under the hood</p>
<p>Recipes stored in plain text, ready for hacking</p>
<p>Open source, everything's on GitHub (<a href="https://github.com/clarklab/chowdown">contribute?</a>)</p>
<p>Jekyll's new <a href="http://jekyllrb.com/docs/collections/">Collections</a> feature (learn with me!)</p>
</div>
</div>
<div class="clearfix white center">
<a href="https://github.com/clarklab/chowdown" class="button button-big button-with-icon button-outline mb4 h2">
<svg class="js-geomicon geomicon" width="30" data-icon="github" viewBox="0 0 32 32" style="fill:currentcolor"><title>github icon</title><path d="M0 18 C0 12 3 10 3 9 C2.5 7 2.5 4 3 3 C6 3 9 5 10 6 C12 5 14 5 16 5 C18 5 20 5 22 6 C23 5 26 3 29 3 C29.5 4 29.5 7 29 9 C29 10 32 12 32 18 C32 25 30 30 16 30 C2 30 0 25 0 18 M3 20 C3 24 4 28 16 28 C28 28 29 24 29 20 C29 16 28 14 16 14 C4 14 3 16 3 20 M8 21 A1.5 2.5 0 0 0 13 21 A1.5 2.5 0 0 0 8 21 M24 21 A1.5 2.5 0 0 0 19 21 A1.5 2.5 0 0 0 24 21 z"></path></svg>
View on GitHub</a>
</div>
</div>
<div class="container mt4 mb4">
<div class="sm-col-6 mx-auto px3 sm-px4">
<p>Hey folks!</p>
<p>My name's Clark and you've just stumbled into <strong>Chowdown</strong>, a plain text recipe database for hackers. Over the years, I've tried dozens of recipe apps and services in an attempt to eat better and get more organized. With each app came a new format and <em>recipe lock-in</em>, neither of which got me excited.</p>
<p><strong>Chowdown</strong> is my attempt at fixing recipe app burnout, by moving my recipes out of closed services and into plain text. For example, here's <a href="https://raw.githubusercontent.com/clarklab/chowdown/gh-pages/_recipes/broccoli-cheese-soup.md">a recipe in plain text</a> that I've been working on for a while. It's a broccoli beer cheese soup inspired by Gourmand's, one of my favorite spots in Austin. Crazy delicious.</p>
<p><a href="http://chowdown.io/recipes/broccoli-cheese-soup.html">Here's that same recipe processed with <strong>Chowdown</strong>.</a> It's a simple layout with a photo, ingredient list, and directions.</p>
<p>The magic comes behind-the-scenes, with <a href="http://schema.org/Recipe">recipe microdata via schema.org</a>. This process adds special tags around each bit of content, which is what let's other apps (list coming soon) read your recipes. Data portability!</p>
<p><strong>Chowdown</strong> is definitely a work in progress. Active development is taking place. I'm new to Jekyll. Things might break. The recipes, however, are here to stay.</p>
<p>Go cook something rad,</p>
<p>Clark<br/><a href="http://twitter.com/clarklab">@clarklab</a></p>
</div>
</div>
</div>
| {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: beta
permalink: beta/
---
| {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
version: "3"
services:
chowdown:
image: jekyll/jekyll
restart: always
container_name: chowdown
command: jekyll serve --force_polling
ports:
- "80:4000"
volumes:
- .:/srv/jekyll
- /opt/docker/chowdown/data/components:/srv/jekyll/_components
- /opt/docker/chowdown/data/images:/srv/jekyll/_images
- /opt/docker/chowdown/data/posts:/srv/jekyll/_posts
- /opt/docker/chowdown/data/recipes:/srv/jekyll/_recipes
| {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: default
---
<div class="post container max-width-2 px2">
<h2>Posts</h2>
{% for post in site.posts %}
<div class="post mb4">
<h1><a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a></h1>
<p>{{ post.content | strip_html | truncatewords:20 }} <a href="{{ site.baseurl }}{{ post.url }}">View Post</a></p>
</div>
{% endfor %}
</div> | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
---
[
{% for post in site.recipes %}
{
"title" : "{{ post.title | escape }}",
{% if post.ingredients %}"ingredients" : "{% for ingredient in post.ingredients %}{{ ingredient | escape }}, {% endfor %}",{% endif %}
{% if post.tags %}"tags" : "{% for tag in post.tags %}{{ tag | escape }} {% endfor %}",{% endif %}
"image" : "{{ site.baseurl }}/images/{{ post.image }}",
"url" : "{{ site.baseurl }}{{ post.url }}"
} {% unless forloop.last %},{% endunless %}
{% endfor %}
]
| {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: default
---
<div class="search container max-width-2">
<div id="search-container">
<h3 class="center mb3 blue">Chowdown Search</h3>
<input type="text" id="search-input" placeholder="search titles or ingredients...">
</div>
</div>
<div class="clearfix">
<div class="recipes xs-px1 xs-mt2 center" id="results-container">
</div>
</div>
<!-- Script pointing to search-script.js -->
<script src="{{site.baseurl}}/plugins/simple-jekyll-search.min.js" type="text/javascript"></script>
<!-- Configuration -->
<script>
SimpleJekyllSearch({
searchInput: document.getElementById('search-input'),
resultsContainer: document.getElementById('results-container'),
json: '{{site.baseurl}}/search.json',
searchResultTemplate: '<div class="sm-col sm-col-6 md-col-6 lg-col-4 xs-px1 xs-mb2 left-align"><a class="block relative bg-blue" href="{url}"><div class="image ratio bg-cover" style="background-image:url({image});"></div><h1 class="title p2 m0 absolute bold white bottom-0 left-0">{title}</h1></a></div>'
})
</script>
<script>
$( document ).ready(function() {
$('#search-input').on('input', function() {
currentHeight = $('#search-container').outerHeight();
$('.search').addClass('used').css('height', currentHeight);
});
});
</script> | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Graham Cracker Crust"
image: graham-cracker-crust.jpg
imagecredit: https://flic.kr/p/atxu75
ingredients:
- 2 cups graham cracker crumbs
- 6 tbs butter (melted)
- 1/3 cup white sugar
- 1 tsp cinnamon
directions:
- pulse graham cracker in food processor or use muddler to crumb in bowl
- combine melted butter, graham cracker crumbs, sugar, and cinnamon in a bowl
- press into pan, forming into crust shape
---
A simple graham cracker crust, perfect for cheesecakes or tarts. | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Vanilla Custard Filling"
image: vanilla-custard.jpg
imagecredit: https://flic.kr/p/99yJqV
ingredients:
- 1/2 cup sugar
- 1/4 cup all-purpose flour
- 1/2 teaspoon salt
- 2 cups milk
- 2 egg yolks, lightly beaten
- 2 teaspoons vanilla extract
directions:
- In a small saucepan, combine the sugar, flour and salt. Stir in milk until smooth.
- Cook and stir over medium-high heat until thickened and bubbly.
- Reduce heat; cook and stir 2 minutes longer.
- Remove from the heat. Stir a small amount of hot filling into egg yolks; return all to the pan.
- Bring to a gentle boil, stirring constantly; cook and stir 2 minutes longer.
- Remove from the heat. Gently stir in vanilla.
---
A simple vanilla custard filling, useful for tarts (or alone by itself in a bowl). | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Red Berry Dessert Topping"
image: red-berry-topping.jpg
imagecredit: https://flic.kr/p/9kczzP
ingredients:
- 1/2 cup raspberries
- 1/2 cup strawberries
- 1/4 white sugar
- 1 squirt honey
directions:
- Dice berries
- Combine all ingredients
- Let rest for 15 mins
---
A simple mash of berries, perfect for a tart or top of cheesecake. | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
<!DOCTYPE html>
<html>
{% include head.html %}
<body>
{% include header.html %}
<div class="page-content">
{{ content }}
</div>
{% include footer.html %}
</body>
</html>
| {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Chowdown Beta</title>
<link href="https://unpkg.com/[email protected]/css/basscss.min.css" rel="stylesheet">
<style>
@import url('https://rsms.me/inter/inter-ui.css');
:root {
--white: #FFFFFF;
--black: #000000;
--light: #EEEEEE;
--blue: #007FFF;
--red: #CC0000;
--primary: var(--red);
}
*{
box-sizing: border-box;
}
.white, a.white{
color: var(--white);
}
.black, a.black{
color: var(--black);
}
.light, a.light{
color: var(--light);
}
.blue, a.blue{
color: var(--primary);
}
.bg-primary{
background-color:var(--primary);
color:var(--white);
}
body{
margin:0;
padding:0;
font-family: 'Inter UI', sans-serif;
font-size:1rem;
line-height: 1.25;
}
a{
color:var(--primary);
}
a.black:hover{
color:var(--primary);
}
nav{
position: fixed;
z-index: 10;
bottom:0;
left:0;
right:0;
background:rgba(255,255,255,0.95);
border-top:2px solid var(--white);
justify-content: space-around;
}
nav .item{
text-align: center;
text-decoration: none;
color:var(--primary);
font-size:.8rem;
padding:.5rem 0;
font-weight: 500;
transition: .2s ease all;
}
nav .item.active{
color:var(--primary);
}
nav .item.active svg{
animation: zap .2s ease forwards;
}
nav .item path, nav .item g{
transition: .2s ease all;
}
nav .item.active path, nav .item.active g{
fill:#CC0000;
}
nav .item:not(.active){
opacity: .4;
}
nav .label{
margin:0;
}
.recipe .image{
}
.recipe:hover .image{
}
.title{
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden;
}
.ratio{
padding-top:50%;
}
.bg-cover{
background-size:cover;
background-position:50% 50%;
}
.slider-outer{
width:100%;
overflow: hidden;
}
@media (orientation: landscape) {
body{
padding-left:20%;
}
nav{
position: fixed;
flex-direction: column;
justify-content: start;
width:20%;
top:0;
bottom:0;
left:0;
right:auto;
padding:1rem 0 0 2rem;
}
nav .item{
text-align: left;
font-size:1.25rem;
padding:.5rem 0 0 2rem;
margin-bottom:1rem;
position: relative;
}
nav .item svg{
position: absolute;
left:-1rem;
top:.25rem;
}
}
#slider{
width:400%;
transition: .3s ease all;
display: flex;
}
#slider.recipes{
transform: translateX(0);
}
#slider.search{
transform: translateX(-25%);
}
#slider.books{
transform: translateX(-50%);
}
#slider.blog{
transform: translateX(-75%);
}
input{
width:100%;
padding:.75rem;
box-sizing: border-box;
font-size:1rem;
font-family: 'Inter UI', sans-serif;
}
input:focus{
outline:2px solid var(--primary);
box-shadow: none;
}
.blog{
height: 100%;
background: var(--light);
}
.card{
background:var(--white);
padding:1rem;
text-decoration: none;
}
.card .action{
text-transform: uppercase;
font-size: 75%;
font-weight: bold;
margin-bottom:0;
}
@keyframes zap {
0% {
transform: scale(1.0);
}
50% {
transform: scale(1.2) rotate(8deg);
}
100%{
transform: scale(1.0);
}
}
</style>
</head>
<body>
<div class="slider-outer">
<div id="slider">
<div class="recipes mb4 col col-3">
<div class="clearfix p1">
{% assign sorted = site.recipes | sort:"date" %}
{% for post in sorted %}
<div class="recipe sm-col sm-col-6 lg-col-4 py1 pb2">
<a class="block relative mx1 text-decoration-none black" href="{{ post.url | prepend: site.baseurl }}">
<div class="image ratio bg-primary bg-cover" {% for image in post.image %} style="background-image:url({{site.baseurl}}/images/{{ image }});"{% endfor %}></div>
<h3 class="title pt1 m0 bold">{{ post.title }}</h3>
</a>
</div>
{% endfor %}
</div>
</div>
<div class="search col col-3">
<div class="search container p2">
<div id="search-container">
<input type="text" id="search-input" placeholder="Search titles, ingredients, or tags...">
</div>
</div>
<div class="clearfix">
<div class="recipes p1" id="results-container">
</div>
</div>
</div>
<div class="books col col-3">
<div class="px2"><h2 class="mt4 pt4 center">Coming Soon!</h2><p class="px3 center">Collections like brunch, grilling, and quick dinners.</p></div>
</div>
<div class="blog col col-3">
<div class="posts container max-width-2 mx-auto p2">
{% for post in site.posts %}
<a class="post card mb2 block" href="{{ post.url }}">
<h3 class="my1">{{ post.title }}</h3>
<p class="mt1">{{ post.content | strip_html | truncatewords:20 }}</p>
<p class="action">View Post</p>
</a>
{% endfor %}
</div>
</div>
</div>
</div>
<nav class="flex">
<a href="#" class="item recipes active">
<svg width="33" height="32" xmlns="http://www.w3.org/2000/svg">
<g fill="#CC0000" fill-rule="nonzero">
<path d="M17 27.533c6.37 0 11.533-5.163 11.533-11.533C28.533 9.63 23.37 4.467 17 4.467 10.63 4.467 5.467 9.63 5.467 16c0 6.37 5.163 11.533 11.533 11.533zM17 30C9.268 30 3 23.732 3 16S9.268 2 17 2s14 6.268 14 14-6.268 14-14 14z"/>
<g transform="rotate(45 -3.503 17.164)">
<path d="M11.634 3.153V2.24h4.835c.24 0 .438.202.438.456a.447.447 0 0 1-.438.456h-4.835zm4.835 1.322c.974 0 1.76-.799 1.76-1.778 0-.98-.786-1.778-1.76-1.778h-6.157v3.555h6.157z"/>
<path d="M6.088 4.604c-.745-.168-1.626-.862-2.598-1.971-.37-.422.217.325-.335-.392h7.089v2.4H6.413c-.104 0-.212-.012-.325-.037zm4.816 1.36h.661V.92H.45l.818 1.063c.57.74.833 1.07 1.228 1.521C3.64 4.808 4.703 5.646 5.797 5.893c.206.046.412.07.616.07h4.491z"/>
</g>
<g transform="rotate(45 2.18 30.663)">
<path d="M2.354 7.178v11.18a.66.66 0 1 0 1.321 0V7.178a.66.66 0 0 0-1.321 0z"/>
<path d="M5.525 5.227a2.511 2.511 0 1 1-5.022 0h5.022zM.503.921h.977v4.306H.503V.921zm4.046 0h.976v4.306H4.55V.921zm-2.023 0h.977v4.306h-.977V.921z"/>
</g>
</g>
</svg>
<p class="label">Recipes</p>
</a>
<a href="#" class="item search">
<svg width="32" height="32" xmlns="http://www.w3.org/2000/svg">
<path d="M19.087 18.205a4.882 4.882 0 1 0 .002-9.764 4.882 4.882 0 0 0-.002 9.764zm5.706-.292l5.726 5.726a1.216 1.216 0 0 1-.002 1.723 1.22 1.22 0 0 1-1.724.002l-5.828-5.827a7.324 7.324 0 1 1 1.829-1.624zM2 10.272c0-.674.414-1.221.913-1.221H8.41c.505 0 .913.542.913 1.22 0 .675-.414 1.222-.913 1.222H2.913c-.505 0-.913-.543-.913-1.221zm0 7.323c0-.674.414-1.221.913-1.221H8.41c.505 0 .913.542.913 1.22 0 .675-.414 1.222-.913 1.222H2.913c-.505 0-.913-.543-.913-1.221zm0 7.323c0-.674.402-1.22.914-1.22H20.31c.505 0 .915.542.915 1.22 0 .674-.402 1.221-.915 1.221H2.914c-.504 0-.914-.542-.914-1.221z" fill="#CC0000" fill-rule="nonzero"/>
</svg>
<p class="label">Search</p>
</a>
<a href="#" class="item books">
<svg width="32" height="32" xmlns="http://www.w3.org/2000/svg">
<path d="M25.568 2.5H6.43C4.814 2.5 3.5 3.86 3.5 5.476v20.877a2.934 2.934 0 0 0 2.93 2.932h19.138a2.936 2.936 0 0 0 2.932-2.932V5.476c0-1.616-1.316-2.976-2.932-2.976zM18.38 4.88h3.571v7.049l-1.041-.833a1.189 1.189 0 0 0-1.488 0l-1.042.833V4.88zM5.88 26.354V5.433a.55.55 0 0 1 .549-.552h1.832v22.024H6.43a.55.55 0 0 1-.549-.551zm20.238 0a.55.55 0 0 1-.551.552H10.643V4.88H16v9.524a1.189 1.189 0 1 0 1.935.93l2.232-1.786 2.232 1.786a1.189 1.189 0 0 0 1.258.144c.414-.2.676-.616.676-1.074V4.88h1.235a.55.55 0 0 1 .551.55v20.922z" fill="#CC0000" fill-rule="nonzero"/>
</svg>
<p class="label">Books</p>
</a>
<a href="#" class="item updates">
<svg width="32" height="32" xmlns="http://www.w3.org/2000/svg">
<g fill="#CC0000" fill-rule="nonzero">
<path d="M20.12 4.92a.715.715 0 0 0-.269-.05c-.319 0-.604.21-.708.522a.814.814 0 0 0 .478 1 9.651 9.651 0 0 1 4.96 4.622 9.65 9.65 0 0 1 .718 6.742.814.814 0 0 0 .512.982c.08.026.163.04.246.04a.74.74 0 0 0 .717-.54 11.19 11.19 0 0 0-.807-7.916 11.202 11.202 0 0 0-5.846-5.401z"/>
<path d="M30.294 8.156A15.983 15.983 0 0 0 21.653.32a.739.739 0 0 0-.263-.049.759.759 0 0 0-.717.525.8.8 0 0 0 .482.994 14.448 14.448 0 0 1 7.752 7.06 14.437 14.437 0 0 1 .99 10.436.799.799 0 0 0 .506.982c.08.027.162.04.244.04.34 0 .63-.215.722-.538 1.12-3.88.737-8.003-1.075-11.616zM14.052 6.796c-.767 0-1.492.168-2.153.497-1.46.73-2.403 2.18-2.77 3.967-2.972 2.963-6.818 5.581-6.858 5.608-2.111 1.43-2.86 4.035-1.78 6.191.818 1.638 2.473 2.586 4.277 2.586.574 0 1.163-.095 1.745-.295.045-.017 4.427-1.517 8.579-2.118.891.425 1.81.658 2.704.658.768 0 1.492-.168 2.153-.497 1.572-.786 2.596-2.39 2.88-4.513.271-2.014-.16-4.282-1.21-6.384-1.706-3.409-4.747-5.7-7.567-5.7zm7.252 11.879c-.215 1.604-.941 2.79-2.044 3.341a3.243 3.243 0 0 1-1.464.335c-2.253 0-4.74-1.948-6.19-4.85-1.84-3.68-1.4-7.643.982-8.835a3.248 3.248 0 0 1 1.463-.334c2.253 0 4.74 1.948 6.19 4.85.916 1.832 1.294 3.782 1.063 5.493z"/>
<path d="M16.043 13.151a.776.776 0 0 0-.35.08c-.607.302-.701 1.35-.21 2.331.386.773 1.061 1.312 1.642 1.312a.759.759 0 0 0 .35-.081c.586-.293.685-1.383.21-2.333-.386-.77-1.06-1.309-1.642-1.309z"/>
<path d="M14.796 15.907c-.484-.968-.51-1.98-.14-2.672l-3.312.984c.149.957.461 1.963.95 2.94a10.03 10.03 0 0 0 1.784 2.523l2.78-2.063c-.794-.125-1.596-.78-2.062-1.712zM12.014 24.6a59.376 59.376 0 0 0-4.988 1.388L8.89 29.71c.28.561.765.982 1.365 1.18a2.34 2.34 0 0 0 1.8-.124l.324-.161a2.364 2.364 0 0 0 1.055-3.167l-1.42-2.839z"/>
</g>
</svg>
<p class="label">Updates</p>
</a>
</nav>
<script type="text/javascript" src='https://code.jquery.com/jquery-3.3.1.min.js'></script>
<script src="/plugins/simple-jekyll-search.min.js" type="text/javascript"></script>
<script>
SimpleJekyllSearch({
searchInput: document.getElementById('search-input'),
resultsContainer: document.getElementById('results-container'),
json: '/search.json',
searchResultTemplate: '<div class="recipe sm-col sm-col-6 lg-col-4 py1 pb2"><a class="block black relative mx1 text-decoration-none" href="{url}"><div class="image ratio bg-primary bg-cover" style="background-image:url({image});"></div><h3 class="title pt1 m0 bold">{title}</h3></a></div>'
})
</script>
<script>
$( document ).ready(function() {
$(".item.recipes").click(function() {
$('#slider').removeClass().addClass('recipes');
$('.item').removeClass('active');
$(this).addClass('active');
});
$(".item.search").click(function() {
$('#slider').removeClass().addClass('search');
$('.item').removeClass('active');
$(this).addClass('active');
});
$(".item.books").click(function() {
$('#slider').removeClass().addClass('books');
$('.item').removeClass('active');
$(this).addClass('active');
});
$(".item.updates").click(function() {
$('#slider').removeClass().addClass('blog');
$('.item').removeClass('active');
$(this).addClass('active');
});
});
</script>
</body>
</html>
| {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: default
---
<div class="post">
<header class="post-header">
<h1 class="post-title">{{ page.title }}</h1>
</header>
<article class="post-content">
{{ content }}
</article>
</div>
| {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: default
---
<div class="container" itemscope itemtype="http://schema.org/Recipe">
<!-- call up the image and image credit link -->
{% for image in page.image %}
<div class="xs-p2">
<img itemprop="image" src="{{site.baseurl}}/images/{{ image }}" />
{% if page.imagecredit %}
{% for imagecredit in page.imagecredit %}
<a href="{{ imagecredit }}" class="right">
<svg class="js-geomicon geomicon" width="14" height="14" data-icon="camera" viewBox="0 0 32 32" style="fill:currentcolor"><title>camera icon</title><path d="M0 6 L8 6 L10 2 L22 2 L24 6 L32 6 L32 28 L0 28 z M9 17 A7 7 0 0 0 23 17 A7 7 0 0 0 9 17"></path></svg>
</a>
{% endfor %}
{% endif %}
</div>
{% endfor %}
<article class="post-content px2">
<!-- call up the main recipe title and content -->
<header class="post-header">
<h1 class="post-title center m1 sm-mt3" itemprop="name">{{ page.title }}</h1>
</header>
<div class="px2 mt3 clearfix">
<div class="sm-col-8 mx-auto" itemprop="description">{{page.content}}</div>
</div>
<div class="mt3 clearfix">
<div class="sm-col sm-col-12 lg-col-12">
{% include nutritional-information.html %}
</div>
</div>
<!-- call up recipe and directions -->
<div class="clearfix mt3">
<div class="sm-col sm-col-6 lg-col-6">
<!-- check if it's a component-based recipe -->
{% if page.components %}
<h4 class="blue mt0 mb2 xs-center">{{ site.translation[site.language].components }}</h4>
<ul>
<!-- list components that make up recipe -->
{% for component in page.components %}
<li>{{ component | markdownify }}</li>
{% endfor %}
</ul>
{% endif %}
{% if page.ingredients %}
<h4 class="blue mt0 mb2 xs-center">{{ site.translation[site.language].ingredients }}</h4>
<ul itemprop="ingredients">
<!-- list ingredients that make up recipe -->
{% for ingredient in page.ingredients %}
<li itemprop="recipeIngredient">{{ ingredient | markdownify }}</li>
{% endfor %}
</ul>
{% endif %}
</div>
<div class="sm-col sm-col-6 lg-col-6">
<h4 class="blue mt0 mb2 xs-center">{{ site.translation[site.language].directions }}</h4>
<ul itemprop="recipeInstructions">
{% for direction in page.directions %}
<li>{{ direction | markdownify }}</li>
{% endfor %}
</ul>
</div>
</div>
<!-- end recipe and directions -->
<!-- check if it's a component-based recipe, render it -->
{% if page.components %}
<div class="components bg-darken-2 p2 mt3 mb3 center">
↓ {{ site.translation[site.language].component_based }} ↓
</div>
<div class="clearfix mxn2">
{% for component in page.components %}
<div class="sm-col sm-col-4 px2">
{% for recipe in site.components %}
{% if recipe.title == component %}
<h4 class="blue center">{{recipe.title}}</h4>
{% for image in recipe.image %}
<div class="image ratio bg-cover" style="background-image:url({{site.baseurl}}/images/{{ image }});">
<img class="hide" itemprop="photo" src="{{site.baseurl}}/images/{{ image }}" />
</div>
{% if recipe.imagecredit %}
{% for imagecredit in recipe.imagecredit %}
<a href="{{ imagecredit }}" class="right">
<svg class="js-geomicon geomicon" width="14" height="14" data-icon="camera" viewBox="0 0 32 32" style="fill:currentcolor"><title>camera icon</title><path d="M0 6 L8 6 L10 2 L22 2 L24 6 L32 6 L32 28 L0 28 z M9 17 A7 7 0 0 0 23 17 A7 7 0 0 0 9 17"></path></svg>
</a>
{% endfor %}
{% endif %}
{% endfor %}
<h4 class="blue regular xs-center">{{ site.translation[site.language].ingredients }}</h4>
<ul class="ingredients" itemprop="ingredients">
{% for item in recipe.ingredients %}
<li itemprop="ingredient">{{ item | markdownify }}</li>
{% endfor %}
</ul>
<h4 class="blue regular xs-center">{{ site.translation[site.language].directions }}</h4>
<ul itemprop="instructions">
{% for item in recipe.directions %}
<li>{{ item | markdownify }}</li>
{% endfor %}
</ul>
{% endif %}
{% endfor %}
</div>
{% endfor %}
</div>
{% endif %}
<!-- end components -->
{% for category in page.categories %}
<p class="clearfix">{{ site.translation[site.language].category }}: <span itemprop="recipeCategory">{{ category }}</span></p>
{% endfor %}
</article>
</div>
<script type="text/javascript">
$( document ).ready(function() {
jQuery.fn.clickToggle = function(a,b) {
var ab=[b,a];
function cb(){ ab[this._tog^=1].call(this); }
return this.on("click", cb);
};
$("ul li").append('<input type="checkbox">');
$("ul li").clickToggle(function(){
$(this).children("input").prop('checked', true);
var height = $(this).height();
var y = $(window).scrollTop();
$('html, body').animate({scrollTop: y+height+16}, 200);
}, function(){
$(this).children("input").prop('checked', false);
var height = $(this).height();
var y = $(window).scrollTop();
$('html, body').animate({scrollTop: y-height-16}, 200);
});
});
</script>
| {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
<!DOCTYPE html>
<html>
{% include head.html %}
<body>
<div class="hero bg-blue"> </div>
{% include header.html %}
<div class="post container max-width-2 px2">
<h1>{{ page.title }}</h1>
{{ content }}
<p class="meta bg-darken-1 p2 mb4">Posted by <a href="https://github.com/{{ page.author }}">@{{ page.author }}</a> on {{ page.date | date: "%b %e, %Y"}}</p>
</div>
{% include footer.html %}
</body>
</html>
| {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
@import url('https://rsms.me/inter/inter-ui.css');
body, button { margin: 0 }
button, input, select, textarea {
font-family: inherit;
font-size: 100%;
}
img { max-width: 100% }
svg { max-height: 100% }
input,
select,
textarea,
fieldset {
font-size: 1rem;
margin-top: 0;
margin-bottom: 0;
}
input[type=text],
input[type=datetime],
input[type=datetime-local],
input[type=email],
input[type=month],
input[type=number],
input[type=password],
input[type=search],
input[type=tel],
input[type=time],
input[type=url],
input[type=week] {
box-sizing: border-box;
height: 2.25rem;
padding: .5rem .5rem;
vertical-align: middle;
-webkit-appearance: none;
}
select {
box-sizing: border-box;
line-height: 1.75;
padding: .5rem .5rem;
}
select:not([multiple]) {
height: 2.25rem;
vertical-align: middle;
}
textarea {
box-sizing: border-box;
line-height: 1.75;
padding: .5rem .5rem;
}
.fieldset-reset {
padding: 0;
margin-left: 0;
margin-right: 0;
border: 0;
}
.fieldset-reset legend {
padding: 0;
}
button,
.button {
font-size: inherit;
font-weight: bold;
text-decoration: none;
cursor: pointer;
display: inline-block;
box-sizing: border-box;
line-height: 1.125rem;
padding: .5rem 1rem;
margin: 0;
height: auto;
border: 4px solid transparent;
vertical-align: middle;
-webkit-appearance: none;
}
button:after,
button:before,
.button:after,
.button:before {
box-sizing: border-box;
}
::-moz-focus-inner {
border: 0;
padding: 0;
}
.button-big{padding: 1.25rem 1.75rem;}
.button-with-icon{padding-left:3.75rem;}
.button-big.button-with-icon svg{position:absolute; left:.6em; top:.6em;}
.button:hover { text-decoration: none }
table {
border-collapse: separate;
border-spacing: 0;
max-width: 100%;
width: 100%;
}
th {
text-align: left;
}
th,
td {
line-height: inherit;
}
th { vertical-align: bottom }
td { vertical-align: top }
body {
font-family: 'Inter UI', Helvetica, sans-serif;
line-height: 1.5;
font-size: 100%;
}
h1, h2, h3, h4, h5, h6 {
font-family: 'Inter UI', Helvetica, sans-serif;
font-weight: bold;
line-height: 1.1;
margin-top: 1em;
margin-bottom: .5em;
}
p, dl, ol, ul {
font-size: 1rem;
margin-top: 0;
margin-bottom: 1rem;
}
pre, code, samp {
font-family: 'Source Code Pro', Consolas, monospace;
font-size: inherit;
}
pre {
margin-top: 0;
margin-bottom: 1rem;
overflow-x: scroll;
}
hr {
margin-top: 2rem;
margin-bottom: 2rem;
}
blockquote {
margin-top: 2rem;
margin-bottom: 2rem;
margin-left: 0;
padding-left: 1rem;
padding-right: 1rem;
}
blockquote,
blockquote p {
font-size: 1.25rem;
font-style: italic;
}
h1, .h1 { font-size: 2rem }
h2, .h2 { font-size: 1.5rem }
h3, .h3 { font-size: 1.25rem }
h4, .h4 { font-size: 1rem }
h5, .h5 { font-size: .875rem }
h6, .h6 { font-size: .75rem }
.list-reset {
list-style: none;
padding-left: 0;
}
.inline { display: inline }
.block { display: block }
.inline-block { display: inline-block }
.overflow-hidden { overflow: hidden }
.overflow-scroll { overflow: scroll }
.overflow-auto { overflow: auto }
.clearfix:before,
.clearfix:after {
content: " ";
display: table
}
.clearfix:after { clear: both }
.left { float: left }
.right { float: right }
.fit { max-width: 100% }
.half-width { width: 50% }
.full-width { width: 100% }
.bold { font-weight: bold; font-weight: bold }
.regular { font-weight: normal }
.italic { font-style: italic }
.caps { text-transform: uppercase; letter-spacing: .2em; }
.left-align { text-align: left }
.center { text-align: center }
.right-align { text-align: right }
.justify { text-align: justify }
.nowrap { white-space: nowrap }
.m0 { margin: 0 }
.mt0 { margin-top: 0 }
.mr0 { margin-right: 0 }
.mb0 { margin-bottom: 0 }
.ml0 { margin-left: 0 }
.m1 { margin: .5rem }
.mt1 { margin-top: .5rem }
.mr1 { margin-right: .5rem }
.mb1 { margin-bottom: .5rem }
.ml1 { margin-left: .5rem }
.m2 { margin: 1rem }
.mt2 { margin-top: 1rem }
.mr2 { margin-right: 1rem }
.mb2 { margin-bottom: 1rem }
.ml2 { margin-left: 1rem }
.m3 { margin: 2rem }
.mt3 { margin-top: 2rem }
.mr3 { margin-right: 2rem }
.mb3 { margin-bottom: 2rem }
.ml3 { margin-left: 2rem }
.m4 { margin: 4rem }
.mt4 { margin-top: 4rem }
.mr4 { margin-right: 4rem }
.mb4 { margin-bottom: 4rem }
.ml4 { margin-left: 4rem }
.mxn1 { margin-left: -.5rem; margin-right: -.5rem; }
.mxn2 { margin-left: -1rem; margin-right: -1rem; }
.mxn3 { margin-left: -2rem; margin-right: -2rem; }
.mxn4 { margin-left: -4rem; margin-right: -4rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.p1 { padding: .5rem }
.py1 { padding-top: .5rem; padding-bottom: .5rem }
.px1 { padding-left: .5rem; padding-right: .5rem }
.p2 { padding: 1rem }
.py2 { padding-top: 1rem; padding-bottom: 1rem }
.px2 { padding-left: 1rem; padding-right: 1rem }
.p3 { padding: 2rem }
.py3 { padding-top: 2rem; padding-bottom: 2rem }
.px3 { padding-left: 2rem; padding-right: 2rem }
.p4 { padding: 4rem }
.py4 { padding-top: 4rem; padding-bottom: 4rem }
.px4 { padding-left: 4rem; padding-right: 4rem }
/* Basscss Responsive White Space */
@media (min-width: 40em) {
.sm-m0 { margin: 0 }
.sm-mt0 { margin-top: 0 }
.sm-mr0 { margin-right: 0 }
.sm-mb0 { margin-bottom: 0 }
.sm-ml0 { margin-left: 0 }
.sm-m1 { margin: .5rem }
.sm-mt1 { margin-top: .5rem }
.sm-mr1 { margin-right: .5rem }
.sm-mb1 { margin-bottom: .5rem }
.sm-ml1 { margin-left: .5rem }
.sm-m2 { margin: 1rem }
.sm-mt2 { margin-top: 1rem }
.sm-mr2 { margin-right: 1rem }
.sm-mb2 { margin-bottom: 1rem }
.sm-ml2 { margin-left: 1rem }
.sm-m3 { margin: 2rem }
.sm-mt3 { margin-top: 2rem }
.sm-mr3 { margin-right: 2rem }
.sm-mb3 { margin-bottom: 2rem }
.sm-ml3 { margin-left: 2rem }
.sm-m4 { margin: 4rem }
.sm-mt4 { margin-top: 4rem }
.sm-mr4 { margin-right: 4rem }
.sm-mb4 { margin-bottom: 4rem }
.sm-ml4 { margin-left: 4rem }
.sm-mxn1 { margin-left: -.5rem; margin-right: -.5rem; }
.sm-mxn2 { margin-left: -1rem; margin-right: -1rem; }
.sm-mxn3 { margin-left: -2rem; margin-right: -2rem; }
.sm-mxn4 { margin-left: -4rem; margin-right: -4rem; }
.sm-mx-auto { margin-left: auto; margin-right: auto; }
}
@media (min-width: 300px) {
.xs-m0 { margin: 0 }
.xs-mt0 { margin-top: 0 }
.xs-mr0 { margin-right: 0 }
.xs-mb0 { margin-bottom: 0 }
.xs-ml0 { margin-left: 0 }
.xs-m1 { margin: .5rem }
.xs-mt1 { margin-top: .5rem }
.xs-mr1 { margin-right: .5rem }
.xs-mb1 { margin-bottom: .5rem }
.xs-ml1 { margin-left: .5rem }
.xs-m2 { margin: 1rem }
.xs-mt2 { margin-top: 1rem }
.xs-mr2 { margin-right: 1rem }
.xs-mb2 { margin-bottom: 1rem }
.xs-ml2 { margin-left: 1rem }
.xs-m3 { margin: 2rem }
.xs-mt3 { margin-top: 2rem }
.xs-mr3 { margin-right: 2rem }
.xs-mb3 { margin-bottom: 2rem }
.xs-ml3 { margin-left: 2rem }
.xs-m4 { margin: 4rem }
.xs-mt4 { margin-top: 4rem }
.xs-mr4 { margin-right: 4rem }
.xs-mb4 { margin-bottom: 4rem }
.xs-ml4 { margin-left: 4rem }
.xs-mxn1 { margin-left: -.5rem; margin-right: -.5rem; }
.xs-mxn2 { margin-left: -1rem; margin-right: -1rem; }
.xs-mxn3 { margin-left: -2rem; margin-right: -2rem; }
.xs-mxn4 { margin-left: -4rem; margin-right: -4rem; }
.xs-mx-auto { margin-left: auto; margin-right: auto; }
}
@media (min-width: 52em) {
.md-m0 { margin: 0 }
.md-mt0 { margin-top: 0 }
.md-mr0 { margin-right: 0 }
.md-mb0 { margin-bottom: 0 }
.md-ml0 { margin-left: 0 }
.md-m1 { margin: .5rem }
.md-mt1 { margin-top: .5rem }
.md-mr1 { margin-right: .5rem }
.md-mb1 { margin-bottom: .5rem }
.md-ml1 { margin-left: .5rem }
.md-m2 { margin: 1rem }
.md-mt2 { margin-top: 1rem }
.md-mr2 { margin-right: 1rem }
.md-mb2 { margin-bottom: 1rem }
.md-ml2 { margin-left: 1rem }
.md-m3 { margin: 2rem }
.md-mt3 { margin-top: 2rem }
.md-mr3 { margin-right: 2rem }
.md-mb3 { margin-bottom: 2rem }
.md-ml3 { margin-left: 2rem }
.md-m4 { margin: 4rem }
.md-mt4 { margin-top: 4rem }
.md-mr4 { margin-right: 4rem }
.md-mb4 { margin-bottom: 4rem }
.md-ml4 { margin-left: 4rem }
.md-mxn1 { margin-left: -.5rem; margin-right: -.5rem; }
.md-mxn2 { margin-left: -1rem; margin-right: -1rem; }
.md-mxn3 { margin-left: -2rem; margin-right: -2rem; }
.md-mxn4 { margin-left: -4rem; margin-right: -4rem; }
.md-mx-auto { margin-left: auto; margin-right: auto; }
}
@media (min-width: 64em) {
.lg-m0 { margin: 0 }
.lg-mt0 { margin-top: 0 }
.lg-mr0 { margin-right: 0 }
.lg-mb0 { margin-bottom: 0 }
.lg-ml0 { margin-left: 0 }
.lg-m1 { margin: .5rem }
.lg-mt1 { margin-top: .5rem }
.lg-mr1 { margin-right: .5rem }
.lg-mb1 { margin-bottom: .5rem }
.lg-ml1 { margin-left: .5rem }
.lg-m2 { margin: 1rem }
.lg-mt2 { margin-top: 1rem }
.lg-mr2 { margin-right: 1rem }
.lg-mb2 { margin-bottom: 1rem }
.lg-ml2 { margin-left: 1rem }
.lg-m3 { margin: 2rem }
.lg-mt3 { margin-top: 2rem }
.lg-mr3 { margin-right: 2rem }
.lg-mb3 { margin-bottom: 2rem }
.lg-ml3 { margin-left: 2rem }
.lg-m4 { margin: 4rem }
.lg-mt4 { margin-top: 4rem }
.lg-mr4 { margin-right: 4rem }
.lg-mb4 { margin-bottom: 4rem }
.lg-ml4 { margin-left: 4rem }
.lg-mxn1 { margin-left: -.5rem; margin-right: -.5rem; }
.lg-mxn2 { margin-left: -1rem; margin-right: -1rem; }
.lg-mxn3 { margin-left: -2rem; margin-right: -2rem; }
.lg-mxn4 { margin-left: -4rem; margin-right: -4rem; }
.lg-mx-auto { margin-left: auto; margin-right: auto; }
}
@media (min-width: 300px) {
.xs-p1 { padding: .5rem }
.xs-py1 { padding-top: .5rem; padding-bottom: .5rem }
.xs-px1 { padding-left: .5rem; padding-right: .5rem }
.xs-p2 { padding: 1rem }
.xs-py2 { padding-top: 1rem; padding-bottom: 1rem }
.xs-px2 { padding-left: 1rem; padding-right: 1rem }
.xs-p3 { padding: 2rem }
.xs-py3 { padding-top: 2rem; padding-bottom: 2rem }
.xs-px3 { padding-left: 2rem; padding-right: 2rem }
.xs-p4 { padding: 4rem }
.xs-py4 { padding-top: 4rem; padding-bottom: 4rem }
.xs-px4 { padding-left: 4rem; padding-right: 4rem }
}
@media (min-width: 40em) {
.sm-p1 { padding: .5rem }
.sm-py1 { padding-top: .5rem; padding-bottom: .5rem }
.sm-px1 { padding-left: .5rem; padding-right: .5rem }
.sm-p2 { padding: 1rem }
.sm-py2 { padding-top: 1rem; padding-bottom: 1rem }
.sm-px2 { padding-left: 1rem; padding-right: 1rem }
.sm-p3 { padding: 2rem }
.sm-py3 { padding-top: 2rem; padding-bottom: 2rem }
.sm-px3 { padding-left: 2rem; padding-right: 2rem }
.sm-p4 { padding: 4rem }
.sm-py4 { padding-top: 4rem; padding-bottom: 4rem }
.sm-px4 { padding-left: 4rem; padding-right: 4rem }
}
@media (min-width: 52em) {
.md-p1 { padding: .5rem }
.md-py1 { padding-top: .5rem; padding-bottom: .5rem }
.md-px1 { padding-left: .5rem; padding-right: .5rem }
.md-p2 { padding: 1rem }
.md-py2 { padding-top: 1rem; padding-bottom: 1rem }
.md-px2 { padding-left: 1rem; padding-right: 1rem }
.md-p3 { padding: 2rem }
.md-py3 { padding-top: 2rem; padding-bottom: 2rem }
.md-px3 { padding-left: 2rem; padding-right: 2rem }
.md-p4 { padding: 4rem }
.md-py4 { padding-top: 4rem; padding-bottom: 4rem }
.md-px4 { padding-left: 4rem; padding-right: 4rem }
}
@media (min-width: 64em) {
.lg-p1 { padding: .5rem }
.lg-py1 { padding-top: .5rem; padding-bottom: .5rem }
.lg-px1 { padding-left: .5rem; padding-right: .5rem }
.lg-p2 { padding: 1rem }
.lg-py2 { padding-top: 1rem; padding-bottom: 1rem }
.lg-px2 { padding-left: 1rem; padding-right: 1rem }
.lg-p3 { padding: 2rem }
.lg-py3 { padding-top: 2rem; padding-bottom: 2rem }
.lg-px3 { padding-left: 2rem; padding-right: 2rem }
.lg-p4 { padding: 4rem }
.lg-py4 { padding-top: 4rem; padding-bottom: 4rem }
.lg-px4 { padding-left: 4rem; padding-right: 4rem }
}
.sm-show, .md-show, .lg-show {
display: none !important
}
@media (min-width: 40em) {
.sm-show { display: block !important }
}
@media (min-width: 52em) {
.md-show { display: block !important }
}
@media (min-width: 64em) {
.lg-show { display: block !important }
}
@media (min-width: 40em) {
.sm-hide { display: none !important }
}
@media (min-width: 52em) {
.md-hide { display: none !important }
}
@media (min-width: 64em) {
.lg-hide { display: none !important }
}
.display-none { display: none !important }
.hide {
position: absolute !important;
height: 4px;
width: 4px;
overflow: hidden;
clip: rect(4px, 4px, 4px, 4px);
}
.relative { position: relative }
.absolute { position: absolute }
.fixed { position: fixed }
.top-0 { top: 0 }
.right-0 { right: 0 }
.bottom-0 { bottom: 0 }
.left-0 { left: 0 }
.z1 { z-index: 1 }
.z2 { z-index: 2 }
.z3 { z-index: 3 }
.z4 { z-index: 4 }
.container {
max-width: 64em;
margin-left: auto;
margin-right: auto;
}
.col {
float: left;
box-sizing: border-box;
}
.col-right {
float: right;
box-sizing: border-box;
}
.col-1 {
width: 8.33333%;
}
.col-2 {
width: 16.66667%;
}
.col-3 {
width: 25%;
}
.col-4 {
width: 33.33333%;
}
.col-5 {
width: 41.66667%;
}
.col-6 {
width: 50%;
}
.col-7 {
width: 58.33333%;
}
.col-8 {
width: 66.66667%;
}
.col-9 {
width: 75%;
}
.col-10 {
width: 83.33333%;
}
.col-11 {
width: 91.66667%;
}
.col-12 {
width: 100%;
}
@media (min-width: 40em) {
.sm-col {
float: left;
box-sizing: border-box;
}
.sm-col-right {
float: right;
box-sizing: border-box;
}
.sm-col-1 {
width: 8.33333%;
}
.sm-col-2 {
width: 16.66667%;
}
.sm-col-3 {
width: 25%;
}
.sm-col-4 {
width: 33.33333%;
}
.sm-col-5 {
width: 41.66667%;
}
.sm-col-6 {
width: 50%;
}
.sm-col-7 {
width: 58.33333%;
}
.sm-col-8 {
width: 66.66667%;
}
.sm-col-9 {
width: 75%;
}
.sm-col-10 {
width: 83.33333%;
}
.sm-col-11 {
width: 91.66667%;
}
.sm-col-12 {
width: 100%;
}
}
@media (min-width: 52em) {
.md-col {
float: left;
box-sizing: border-box;
}
.md-col-right {
float: right;
box-sizing: border-box;
}
.md-col-1 {
width: 8.33333%;
}
.md-col-2 {
width: 16.66667%;
}
.md-col-3 {
width: 25%;
}
.md-col-4 {
width: 33.33333%;
}
.md-col-5 {
width: 41.66667%;
}
.md-col-6 {
width: 50%;
}
.md-col-7 {
width: 58.33333%;
}
.md-col-8 {
width: 66.66667%;
}
.md-col-9 {
width: 75%;
}
.md-col-10 {
width: 83.33333%;
}
.md-col-11 {
width: 91.66667%;
}
.md-col-12 {
width: 100%;
}
}
@media (min-width: 64em) {
.lg-col {
float: left;
box-sizing: border-box;
}
.lg-col-right {
float: right;
box-sizing: border-box;
}
.lg-col-1 {
width: 8.33333%;
}
.lg-col-2 {
width: 16.66667%;
}
.lg-col-3 {
width: 25%;
}
.lg-col-4 {
width: 33.33333%;
}
.lg-col-5 {
width: 41.66667%;
}
.lg-col-6 {
width: 50%;
}
.lg-col-7 {
width: 58.33333%;
}
.lg-col-8 {
width: 66.66667%;
}
.lg-col-9 {
width: 75%;
}
.lg-col-10 {
width: 83.33333%;
}
.lg-col-11 {
width: 91.66667%;
}
.lg-col-12 {
width: 100%;
}
}
.flex { display: flex }
.flex-column { flex-direction: column }
.flex-wrap { flex-wrap: wrap }
.flex-center { align-items: center }
.flex-baseline { align-items: baseline }
.flex-stretch { align-items: stretch }
.flex-start { align-items: flex-start }
.flex-end { align-items: flex-end }
.flex-justify { justify-content: space-between }
.flex-first { order: -1 }
.flex-last { order: 1024 }
.flex-auto { flex: 1 1 auto }
.flex-grow { flex: 1 0 auto }
.flex-none { flex: none }
.flex > div { box-sizing: border-box }
@media (min-width: 40em) {
.sm-flex { display: flex }
.sm-flex > div { box-sizing: border-box }
}
@media (min-width: 52em) {
.md-flex { display: flex }
.md-flex > div { box-sizing: border-box }
}
@media (min-width: 64em) {
.lg-flex { display: flex }
.lg-flex > div { box-sizing: border-box }
}
body {
color: #111;
background-color: white;
}
a {
color: #007FFF;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
pre, code {
border-radius: 3px;
}
hr {
border: 0;
border-bottom-style: solid;
border-bottom-width: 4px;
border-bottom-color: rgba(0,0,0,.125);
}
.button {
color: white;
background-color: #007FFF;
border-radius: 3px;
transition-duration: .05s;
transition-timing-function: ease-out;
transition-property: background-color;
}
.button:focus {
outline: none;
border-color: rgba(0,0,0,.125);
box-shadow: 0 0 0 3px rgba(0,0,0,.25);
}
.button:active,
.button.is-active {
box-shadow: inset 0 0 0 20rem rgba(0,0,0,.125),
inset 0 3px 4px 0 rgba(0,0,0,.25),
0 0 4px rgba(0,0,0,.125);
}
.button:disabled,
.button.is-disabled {
opacity: .5;
}
.field-light {
background-color: white;
transition: box-shadow .2s ease;
border-style: solid;
border-width: 4px;
border-color: rgba(0,0,0,.125);
border-radius: 3px;
}
.field-light:focus {
outline: none;
border-color: #007FFF;
box-shadow: 0 0 0 2px rgba(0, 127, 255, 0.5);
}
.field-light:disabled {
background-color: rgba(0,0,0,.125);
opacity: .5;
}
.field-light:read-only:not(select) {
background-color: rgba(0,0,0,.125);
}
.field-light:invalid {
border-color: #ff4136;
}
.field-light.is-success {
border-color: #2ecc40;
}
.field-light.is-warning {
border-color: #ffdc00;
}
.field-light.is-error {
border-color: #ff4136;
}
.field-dark {
color: white;
background-color: rgba(0,0,0,.25);
border: 4px solid rgba(0,0,0,.0625);
border-radius: 3px;
border-radius: 3px;
}
.field-dark::placeholder {
color: rgba(255,255,255,.75);
}
.field-dark:focus {
outline: 0;
border: 4px solid rgba(255,255,255,.5);
box-shadow: 0 0 0 2px rgba(255,255,255,.25);
}
.field-dark:read-only:not(select) {
background-color: rgba(255,255,255,.25);
}
.field-dark:invalid {
border-color: #ff4136;
}
.field-dark.is-success {
border-color: #2ecc40;
}
.field-dark.is-warning {
border-color: #ffdc00;
}
.field-dark.is-error {
border-color: #ff4136;
}
input[type=range] {
vertical-align: middle;
background-color: transparent;
}
.progress {
display: block;
width: 100%;
height: 0.5625rem;
margin: .5rem 0;
background-color: rgba(0,0,0,.125);
border: 0;
border-radius: 10000px;
overflow: hidden;
-webkit-appearance: none;
}
.progress::-webkit-progress-bar {
-webkit-appearance: none;
background-color: rgba(0,0,0,.125)
}
.progress::-webkit-progress-value {
-webkit-appearance: none;
background-color: currentColor;
}
.progress::-moz-progress-bar {
background-color: currentColor;
}
.table-light th,
.table-light td {
border-bottom-width: 4px;
border-bottom-style: solid;
border-bottom-color: rgba(0,0,0,.125);
}
.table-light tr:last-child td {
border-bottom: 0;
}
.button-outline {
position: relative;
z-index: 2;
color: inherit;
background-color: transparent;
border-radius: 3px;
border: 4px solid currentcolor;
transition-duration: .1s;
transition-timing-function: ease-out;
transition-property: box-shadow, background-color;
}
.button-outline:before {
content: '';
display: block;
position: absolute;
z-index: -1;
top: -4px;
right: -4px;
bottom: -4px;
left: -4px;
border: 4px solid transparent;
background-color: currentcolor;
border-radius: 3px;
transition-duration: .1s;
transition-timing-function: ease-out;
transition-property: opacity;
opacity: 0;
}
.button-outline:hover {
box-shadow: none;
}
.button-outline:hover:before,
.button-outline:focus:before {
opacity: .125;
}
.button-outline:focus {
outline: none;
border: 4px solid currentcolor;
box-shadow: 0 0 0 2px;
}
.button-outline:active,
.button-outline.is-active {
box-shadow: inset 0 4px 5px 0, 0 0 4px;
}
.button-outline:disabled,
.button-outline.is-disabled {
opacity: .5;
}
.button-transparent {
position: relative;
z-index: 2;
color: inherit;
background-color: transparent;
border-radius: 0;
border: 4px solid transparent;
transition-duration: .1s;
transition-timing-function: ease-out;
transition-property: box-shadow;
}
.button-transparent:before {
content: '';
display: block;
position: absolute;
z-index: -1;
top: -4px;
right: -4px;
bottom: -4px;
left: -4px;
border: 4px solid transparent;
background-color: currentcolor;
transition-duration: .1s;
transition-timing-function: ease-out;
transition-property: opacity;
opacity: 0;
}
.button-transparent:hover {
box-shadow: none;
}
.button-transparent:hover:before,
.button-transparent:focus:before {
opacity: .09375;
}
.button-transparent:focus {
outline: none;
border-color: transparent;
box-shadow: 0 0 0 2px;
}
.button-transparent:active,
.button-transparent.is-active {
box-shadow: none;
}
.button-transparent:active:before,
.button-transparent.is-active:before {
opacity: .0625;
}
.button-transparent:disabled,
.button-transparent.is-disabled {
opacity: .5;
}
.bg-cover { background-size: cover }
.bg-contain { background-size: contain }
.bg-center { background-position: center }
.bg-top { background-position: top }
.bg-right { background-position: right }
.bg-bottom { background-position: bottom }
.bg-left { background-position: left }
.border {
border-style: solid;
border-width: 4px;
border-color: rgba(0,0,0,.125);
}
.border-top {
border-top-style: solid;
border-top-width: 4px;
border-top-color: rgba(0,0,0,.125);
}
.border-right {
border-right-style: solid;
border-right-width: 4px;
border-right-color: rgba(0,0,0,.125);
}
.border-bottom {
border-bottom-style: solid;
border-bottom-width: 4px;
border-bottom-color: rgba(0,0,0,.125);
}
.border-left {
border-left-style: solid;
border-left-width: 4px;
border-left-color: rgba(0,0,0,.125);
}
.rounded { border-radius: 3px }
.circle { border-radius: 50% }
.rounded-top { border-radius: 3px 3px 0 0 }
.rounded-right { border-radius: 0 3px 3px 0 }
.rounded-bottom { border-radius: 0 0 3px 3px }
.rounded-left { border-radius: 3px 0 0 3px }
.not-rounded { border-radius: 0 }
.black, .dark-gray { color: #111 }
.gray, .mid-gray { color: #aaa }
.silver, .light-gray { color: #ddd }
.white { color: #fff }
.aqua { color: #7fdbff }
.blue { color: #007FFF }
.navy { color: #001f3f }
.teal { color: #39cccc }
.green { color: #2ecc40 }
.olive { color: #3d9970 }
.lime { color: #01ff70 }
.yellow { color: #ffdc00 }
.orange { color: #ff851b }
.red { color: #ff4136 }
.fuchsia { color: #f012be }
.purple { color: #b10dc9 }
.maroon { color: #85144b }
.bg-black, .bg-dark-gray { background-color: #111 }
.bg-gray, .bg-mid-gray { background-color: #aaa }
.bg-silver, .bg-light-gray { background-color: #ddd }
.bg-white { background-color: #fff }
.bg-aqua { background-color: #7fdbff }
.bg-blue { background-color: #007FFF }
.bg-navy { background-color: #001f3f }
.bg-teal { background-color: #39cccc }
.bg-green { background-color: #2ecc40 }
.bg-olive { background-color: #3d9970 }
.bg-lime { background-color: #01ff70 }
.bg-yellow { background-color: #ffdc00 }
.bg-orange { background-color: #ff851b }
.bg-red { background-color: #ff4136 }
.bg-fuchsia { background-color: #f012be }
.bg-purple { background-color: #b10dc9 }
.bg-maroon { background-color: #85144b }
.bg-darken-1 { background-color: rgba(0,0,0,.0625) }
.bg-darken-2 { background-color: rgba(0,0,0,.125) }
.bg-darken-3 { background-color: rgba(0,0,0,.25) }
.bg-darken-4 { background-color: rgba(0,0,0,.5) }
.border-aqua { border-color: #7fdbff }
.border-blue { border-color: #007FFF }
.border-navy { border-color: #001f3f }
.border-teal { border-color: #39cccc }
.border-green { border-color: #2ecc40 }
.border-olive { border-color: #3d9970 }
.border-lime { border-color: #01ff70 }
.border-yellow { border-color: #ffdc00 }
.border-orange { border-color: #ff851b }
.border-red { border-color: #ff4136 }
.border-fuchsia { border-color: #f012be }
.border-purple { border-color: #b10dc9 }
.border-maroon { border-color: #85144b }
.border-black { border-color: #111 }
.border-gray { border-color: #aaa }
.border-silver { border-color: #ddd }
.border-white { border-color: #fff }
.border-darken-1 { border-color: rgba(0,0,0,.0625) }
.border-darken-2 { border-color: rgba(0,0,0,.125) }
.border-darken-3 { border-color: rgba(0,0,0,.25) }
.border-darken-4 { border-color: rgba(0,0,0,.5) }
.muted { opacity: .5 } | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
# Only the main Sass file needs front matter (the dashes are enough)
---
img{width:100%;}
.no-line-height{line-height:0;}
ul{margin:0; padding:0; list-style:none;}
ul li{ padding:0 0 0 25px; position:relative;}
ul li input{position: absolute; top:5px; left:0; opacity:0.5;}
.bg-blue-tile{background: #007FFF url(../assets/tile.png); position:relative;}
@media all and (min-width:40em){
.bg-blue-tile:after{position:absolute; top:0; left:0; right:0; bottom:0; content:" "; box-shadow:inset 0 0 100px 20px #007FFF; z-index:1; pointer-events:none;}
}
.max-width-4{max-width:64em}
.max-width-3{max-width:52em}
.max-width-2{max-width:40em}
.search input{border-radius:5px; border:2px solid #eee; box-shadow:0 0 14px rgba(#007FFF,0.1); width:100%; padding:1.5rem}
.search input:focus{outline:none; border:2px solid #007FFF;}
.search{transition:.3s ease height; height:90vh; display:flex; flex-direction: column; justify-content:center;}
.hero{height:150px;}
.post h1{margin-top:6rem}
.post ol, .post ul{}
.post li{margin-bottom:1rem; padding:0 0 0 1rem;}
.post li:before{content:"- "; position:absolute; left:0; color:#007FFF}
a .image{transition:.2s ease all; opacity:1;}
a:hover .image{opacity:0.2;}
.ingredients p{margin-bottom:0.5rem;}
.sell .sm-col a{text-decoration:none; color:#fff; border-bottom:2px solid rgba(255,255,255,0.5);}
.ratio{padding-top:50%; background-position: center center; background-repeat:no-repeat;}
@media all and (max-width:40em){
.left-align{text-align:center;}
.right-align{text-align:center;}
}
@media all and (max-width: 300px){
.title{font-size:1.3rem; text-align:center; box-sizing:border-box; width:100%;}
.xs-center{text-align: center}
.site-title{bottom:-28px; top:auto; left:50%; margin-left:-25px; border-radius:200px; transition:.2s ease bottom}
.site-title:hover{bottom:-14px;}
.recipes .sm-col{border-bottom:3px solid white}
}
.border-1 { border-width: 1px; }
.border-1:active { border-width: 1px; }
.capitalize { text-transform: capitalize; }
| {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="icons/mstile-150x150.png"/>
<TileColor>#007fff</TileColor>
</tile>
</msapplication>
</browserconfig>
| {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: post
title: "Hot stuff! New /beta now cookin..."
author: clarklab
---
Just a quick note to say I've started work on the overhaul of the front-end templates. You can follow along at [https://chowdown.io/beta](https://chowdown.io/beta). Some highlights:
- **Mobile First.** In fact, maybe don't check it on desktop yet.
- **Tabbed View.** New bottom nav for easier jumping.
- **Books.** Aka cookbooks aka collections aka groups are coming soon.
- **Live Search.** It's been working, now it's being featured.
- **Blog**. Same. We've had one, now it has a home.
I've got a handful of other things coming soon, excited to share with y'all. Until then, happy cooking! | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: post
title: "HTTPS, Live Search, and a new blog"
author: clarklab
---
After a few years on the backburner, we're finally moving Chowdown up to a low simmer. We're back with a slew of updates like HTTPS, live search, our first pull request, and this blog!
A quick runthough the new goodness:
- HTTPS for [chowdown.io](https://chowdown.io) is now enabled by default, thanks to recent changes by Github Pages. If you're hosting with Github, enabling it for your own site is as simple as using the correct A/CNAME/DNS records.
- A simple live search is now available at [/search](/search). It indexes the recipe title and the ingredients (so you could find stuffed peppers by searching either "pepper" or "goat cheese").
- This may seem ordinary elsewhere, but I wanted to take a quick minute to celebrate Chowdown's first pull request. We've had a few forks and comments over the years, but I wasn't really watching the project like I should, and now that we're back on track, it's time to celebrate 🎉🙌. You can see it [here](https://github.com/clarklab/chowdown/pull/8), where [@maartenpaauw](https://github.com/maartenpaauw) submitted a little fix that enabled component recipes to have ingredients of their own. Nice!
- A new readme is up in the root of the repo, (read it [here](https://github.com/clarklab/chowdown)). Moving forward, I'll keep updating it and plan to keep an eye on the beginner use-case (which is me, I'm still new to Jekyll).
- Changed the default typeface to [Inter UI](https://rsms.me/inter/), from Rasmus Andersson. Previously we were using [Karla](https://fonts.google.com/specimen/Karla).
- Last but not least, I've added a simple blog template (this one!). That means I'll be posting some updates here on [chowdown.io](https://chowdown.io), but also that you can use the blogging template in your own install (if you're into that).
New features hopefully coming in the next few weeks:
- Reworked templates, including some design tweaks and a swap to the latest version of BassCSS.
- PWA stuffs, like more "add to homescreen" and offline caching.
I'll try to post some updates on new projects soon, and I'm always looking for feedback (and recipes! submit via pull request!). Until then, happy cooking! | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Crockpot Buffalo Chicken"
image: crockpot-buffalo-chicken.jpg
tags: mains, grill, party
ingredients:
- 6-8 chicken breasts
- 1 packet ranch mix
- 1 bottle Frank's Red Hot
- 1 stick of butter
directions:
- Add all the above into a crockpot, cook on low for 6-8 hours
- Shred chicken when soft
- Serve with pickles and Hawaiian rolls
---
This is a party favorite, perfect for a Super Bowl or a game night. It takes a long time, but like most slow cooker recipes, is easy as hell. Bonus: guests love it. | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Crispy Carrots"
image: crispy-carrots.jpg
tags: veg, party
ingredients:
- 1 lb carrot sticks (or baby carrots)
- 2 oranges (or any citrus)
- 2 tbsp butter
- 1 package phyllo dough
- 1/2 cup honey
- sesame seeds to top
- vegetable oil
directions:
- Start by parboiling your carrots in 2 cups of water (means party boil).
- Zest and juice the oranges.
- When the carrots are jussst soft, drain the water. Add the butter, the zest, and the orange juice. Simmer until thick and declious. It's fine (and good) if the carrots are still a bit undercooked (we're going to bake them next).
- Unroll the phyllo dough and cut it into three equal sections. With a brush, oil the top of each sheet.
- Roll a carrot with a single section of phyllow dough, place on a baking sheet. Repeat and repeat and repeat.
- When a full baking sheet is ready, brush the top of each roll with a little oil. Don't worry about placing them too far about, they won't raise much (at all).
- Bake according to your phyllo dough box.
- With 5 minutes left, brush the top of each roll with honey, then sprinkle with sesame seeds.
---
This is another recipe we saw on Jamie Oliver's TV show, and we can't stop making it. It's perfect for parties, and pairs well with any rich dip (we've been doing greek yogurt topped with hot sauce and tahini). We've also rolled things other than carrots, changed the flavors, made news dips— go wild! | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Pork Steaks"
image: pork-steaks.jpg
tags: mains, meat
ingredients:
- pork shoulder (or other cheap cut)
- immerison circulator (we like the [Anova](http://www.amazon.com/gp/product/B00UKPBXM4/ref=as_li_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=B00UKPBXM4&linkCode=as2&tag=repl-20&linkId=XMRXWQ35OJNCZVGE))
directions:
- Sous vide the pork at 140° for 24h
- Submerge bag into an ice bath to completely cool
- Cut and portion the cold roast into individual steaks
- Seal and save (fridge for 3 days, freezer for longer)
- To serve, reheat in bag, sear in sourching hot pan
---
Pork is called "the other white meat", but this sous vide technique is so dang good I'm gonna graduate it up to "THE white meat". | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Stuffed Peppers"
image: stuffed-peppers.jpg
tags: side, party
ingredients:
- 1 jar Peppedew Peppers (or piquante pepper)
- 4oz goat cheese (any flavor)
- 1 tbsp mayonnaise
- 1 tbsp sour cream
- 1 bunch of chives, chopped
- hearty shot of hot sauce (Franks, Yellowbird)
- hearty crack of pepper
directions:
- combine goat cheese, mayo, sour cream, 2/3rds of your chives, hot sauce, black pepper
- if you are feeling spry, beat the mixture to make it fluffy
- put filling in a plastic bag, snip of the tip with scissors to make a piping bag
- fill peppers, place in bowl, top with chives and hot sauce
---
We found these during Happy Hour at Chiso's Grill in Bee Cave, Tx. We've since tweaked the recipe a bit. This recipe is just a starting point, add/remove anything you want (like more hot sauce if you're into that). Sometimes I order the [peppers on Amazon](https://amzn.to/2MGUnam). My favorite hot sauces are Franks Red Hot, Jardine's Texas Champagne, and of course, [Yellowbird](https://amzn.to/2Pw4LAv).
Fun fact: Peppedew Peppers are basically a new thing. They are the brand name of piquante peppers, which were discovered in South Africe in just 1993. Hat tip to [Wikipedia](https://en.wikipedia.org/wiki/Peppadew) for the schooling. | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Mushroom Risotto"
image: mushroom-risotto.jpg
tags: mains, veg
ingredients:
- 10oz shitake mushrooms (we usually buy two 5oz grocery packages)
- 1 cup arborio rice
- 2 cups chicken stock
- 4 tbsp butter (halved)
- 1 small onion, diced
- 6 cloves garlic
- 1.5 cups white wine
- 1 cup beer (drink the rest)
- half a lemon
- 1 cup fresh grated parmesan cheese, plus more for serving
- sprig of parsley (or your favorite herb)
- salt
- pepper
directions:
- Add the chicken stock, 1 cup white wine, and 1 cup beer to a stock pock and bring to a simmer (4 cups total). Reduce heat or set aside.
- Add 2 tbsp butter, garlic, and onions to a deep pan and cook until translucent (a couple minutes). Add one package (or half) of your mushrooms and cook down. Salt and pepper to taste (small dash of salt, hearty crack of pepper for me, please).
- Add the rice into the pan and toss to coat. Toast for a few minutes.
- Add the remaining white wine and juice from half a lemon to deglaze the pan, scraping up all the good bits.
- Add a large ladle (or two) of the hot stock mixture into the rice pan. Here's where we get patient. Cook the stock down (near dry) before adding another ladle. Repeat.
- Continue to add a ladle at a time, letting it fully absord while stirring, until the stock is gone or the rice is tender. Fair game to taste the rice a few times in search of the perfect tenderness.
- Meanwhile, let's roast our other pack of fresh mushrooms. Get the remaining half on a sheet pan and under a 450° broiler. Keep an eye on them but cook til crispy and brown on the edges.
- When the rice is tender and the mushrooms in the oven are crisp, stir your parmesan and remaining 2tbps butter into the rice. Plate your risotto and top with our roasted mushrooms, our herb, more parmesan, and a crack of black pepper.
---
Risotto is one of those recipes that sound tough but really isn't that tricky (but is totally tasty). This recipe is a mash between a [Jamie Oliver](https://www.jamieoliver.com/recipes/rice-recipes/grilled-mushroom-risotto/) method and a [Tasty 101 video](https://tasty.co/recipe/mushroom-risotto). Jamie asked for dried mushrooms (proved to be hard to find and expensive here) and Tasty didn't have enough mushroom punch (so we added back the roasted topper). The best of both worlds, and easier than I've previously imagined! | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Broccoli Beer Cheese Soup"
image: broccoli-beer-cheese-soup.jpg
tags: sides, soups
ingredients:
- 4 tablespoons butter
- 1 cup diced onion
- 1/2 cup shredded carrot
- 1/2 cup diced celery
- 1 tablespoon garlic
- 1/4 cup flour
- 1 quart chicken broth
- 1 cup heavy cream
- 10 ounces muenster cheese
- 1 cup white white wine
- 1 cup pale beer
- 1 teaspoon Worcestershire sauce
- 1/2 teaspoon hot sauce
directions:
- Start with butter, onions, carrots, celery, garlic until cooked down
- Add flour, stir well, cook for 4-5 mins
- Add chicken broth, bring to a boil
- Add wine and reduce to a simmer
- Add cream, cheese, Worcestershire, and hot sauce
- Serve with croutons
---
This recipe is inspired by one of my favorites, Gourmand's Beer Cheese Soup, which uses Shiner Bock. Feel free to use whatever you want, then go to [Gourmand's](http://lovethysandwich.com) to have the real thing. | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Sweet potato cakes with poached eggs"
image: sweet-potato-cakes-with-poached-eggs.jpg
tags: fancy, vegetarian
ingredients:
- 4 eggs + 4 egg whites
- 100g harissa
- 200g Greek yogurt
- herbs
- 500g sweet potato
- 200g flour
- 1 pack parsley
- olive oil
directions:
- peel and grate sweet potatos, squeeze excess moisture.
- combine with flour, parsley, 4 egg whites, half the harissa and some salt in abowl until the mixture sticks together
- shape into 8 potato cakes
- using a little oil, fry the potato cakes for 2-3 mins each side until golden brown and crisp. Keep warm.
- poach the eggs for 2-3 mins, the yolks should be runny. Drain on kitchen paper.
- spread some harissa in the middle of four serving plates and top with a dollop of yogurt. Add one potato cake on top with more yogurt. Top each stack with the remaining yogurt and an egg.
- Season and drizzle with more harissa and scatter over the herbs.
---
Source: [BBC Good Food](https://www.bbcgoodfood.com/recipes/sweet-potato-harissa-cakes-poached-eggs)
I found this recipe just after I finished school, when I was on a cooking spree.
It's a very delicious, very fancy dish that brings me joy whenever I get to cook and serve it. | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Salt & Vinegar Potatoes"
image: salt-vinegar-potatoes.jpg
imagecredit: https://www.nigella.com/recipes/salt-and-vinegar-potatoes
tags: sides, veg
ingredients:
- small potatoes
- splash of oil/butter
- splash of vinegar
- dash of salt
directions:
- Start by boiling or steaming your potatoes. When they are approaching fork tender, pull them out and smash each one. Don't mash them, just crush each potato until it just starts to crack.
- In a baking pan, add a bit of butter and olive oil (to taste and/or diet) and bake at 400° for a few minutes or until it's nice and hot. Toss the potatoes in the hot oil.
- Bake and then broil at 400° until the potatoes are brown and then skins are crisp.
- Toss in a splash of vinegar (I like plain white, some use apple cider or red wine vinegar) and a pinch of good sea salt.
---
This recipe [popped up](https://www.nigella.com/recipes/salt-and-vinegar-potatoes) via Google auto suggestion, probably because I love chips, and it's a super pairing for a nice roast or bird. Adjust your amount of potatoes and oil/butter to your serving size and taste. | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Sweet red lentil and vegetable salad"
image: red-lentil-salad.jpg
tags: fancy, vegetarian
ingredients:
- red lentils
- vegetable broth
- eggplant
- zucchini
- cherry tomatos
- olive oil
- pepper
- some flavouring sauce (soy sauce, sesame oil, )
- (optional) sesame seeds
- (optional) honey
directions:
- Cook the lentils firm to the bite according to package instructions, don't forget to add vegetable broth to the water.
- Cut eggplant and zucchini to big, but eatable slices. Marinate in olive oil, pepper and the flavouring sauce.
- Heat remaining marinade in a pan. When hot, add eggplant and zucchini and fry until golden brown.
- Add cherry tomatos.
- Add some sesame seeds, maybe some more oil or honey. Cover to capture heat.
- Drain lentils, season to your liking. Maybe add some honey to give it a sweet taste.
- Combine lentils and vegetables in a bowl. Cool down.
- Serve with some sprinkles of sesame and some honey on top.
---
Source: My imagination
This tastes surprisingly good, especially when it's cold.
Good as a barbecue salad or a pre-made dish. | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Falafel-Hummus Plate"
image: falafel-hummus-plate.jpg
tags: vegetarian, fast, chickpeas
ingredients:
- falafel
- olives
- eggplant
- carrots
- sugar
- tahini
- hummus
- sesame seeds
- olive oil
- pomegranate seeds
- parsley
- vinegar
- salt, pepper, chili flakes
directions:
- prepare Hummus and Falafel dough according to recipe
- cut eggplant into 1cm pieces, slice carrot in half a centimeter slices.
- saute eggplant and carrot slice together in some oil, sugar
- carammelize some sugar in a pan, add eggplant and carrot slices. Sauté until soft.
- Chop parsley and combine with pomegranate seeds and some vinegar to create a side salad
- form Falafel balls, touch into sesame seeds and fry until golden brown using some olive oil
- serve Falafel ontop of hummus aside olives, parsley salad, eggplant-carrot-mixture
- decorate using chili flakes and tahini
---
I first ate this 2019 at a restaurant in Brussels where I was together with my sister.
It's an easy, very delicious plate that can be served in many different variations.
| {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Roasted Brussels Sprouts"
image: roasted-brussels-sprouts.jpg
tags: sides, vegetables
ingredients:
- 1 bunch of brussels, sliced thin
- 2 tbsp olive oil
- (optional) grated hard cheese
- (optional) gold raisins or sweetened cranberries
- (optional) assorted veggies, sliced thin
- salt, pepper, etc to taste
directions:
- Wash and thinly slice the brussels sprouts (or buy them pre-sliced at HEB or Central Market)
- Toss the brussels (+ optional veggies), olive oil, and salt + pepper on a baking sheet
- Roast under the broiler for 10-15 mins, keeping a close eye
- Remove from the oven when the edges just start to blacken
- Toss with optional ingredients (depending on how healthy you're feeling)
---
A lot of places are doing dang good brussels lately, but none can touch [Salty Sow](http://saltysow.com/). They serve them fried, topped with pecorino and golden raisins. Yes, please.
We started trying to emulate it, but it's such a versatile dish, you can make it however you want. Consider this a loose guide. | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "One Minute Muffin"
image: one-minute-muffin.jpg
imagecredit: http://divaliciousrecipes.com/2012/04/26/flax-muffin-in-a-mug-in-a-minute-low-carb-and-gluten-free/
tags: breakfast
ingredients:
- 1⁄4 cup flax seed meal
- 1⁄2 teaspoon baking powder
- 1 teaspoon cinnamon
- 1 egg
- 1 teaspoon oil
- sugar to taste (or honey, stevia)
directions:
- Mix all ingredients in a coffee mug.
- Micorowave for one minute on high.
---
This flax muffin is quick, vertsatile (just mix in other goodies), and only makes one at a time, so you've got no huge tray to tempt you. Custom muffins every morning! | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Downtown Marinade"
image: downtown-marinade.jpg
tags: party, meat
ingredients:
- 1 cup Italian dressing
- 1/4 cup soy sauce
- 1/4 cup chili paste (like [sambal oelek](https://amzn.to/2NuqquF))
- 1/4 sugar
- dash hot sauce (like Texas Champagne or Yellowbird)
directions:
- Mix everythiing in a large zip bag (or bowl)
- Toss meat and let sit (from 1-36hr)
---
This is my go-to marinade for everything from steaks to shrimp to fajitas to pork. Seriously, if I'm cooking or grilling meat, there's a good chance this is what it's soaking in. It's perfect for "street meat" aka cart or truck, like tacos and wraps and kebabs and skewers and everything in between. Start with this base, add spice or herb as desired. | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Green Chile Stew"
image: green-chile-stew.jpg
imagecredit: https://flic.kr/p/4CJb65
tags: sides, soups
ingredients:
- 1 jar of [green chile stew mix](http://amzn.to/1KYXSjo)
- 1lb ground chicken
- 1 red onion
- 1 green onion
- 1 can corn
directions:
- Start onions in pan, cook down
- Add chicken, corn
- Add stew mix
- Serve with croutons
---
This is a simple one, consisting of a pre-made soup mix and whatever you've got around the kitchen (or campsite). Feel free to sub/swap/switch anything in the ingredient list— anything's fair game! | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Pace Pork"
image: pace-pork.jpg
tags: mains, crock pot
ingredients:
- pork shoulder (or loin)
- 1 jar of Pace Picante
directions:
- Combine the pork and Pace Picante in the crockpot
- Cook on slow for 8hrs or so (until it shreds)
- Eat on buns, on tortillas, with chips or nachos, etc
---
This recipe comes from Cody, a childhood neighbor and friend that my brother and I group chat message about food literally every day. Hey Cody!
Consider this a starting point. This is totally one of those "starter meats" that you coud add to almost any dish. | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Red Berry Tart"
image: red-berry-tart.jpg
tags: desserts
directions:
- Bake the crust and let it cool
- Make the custard, pour into crust
- Make the red berry topping, spread over the top
components:
- Graham Cracker Crust
- Vanilla Custard Filling
- Red Berry Dessert Topping
---
A favorite when I go to BBQs (parties, hackathons, your folks' place), this red berry tart is fairly easy to make and packs a huge wow factor. | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "New York Strip"
image: new-york-strip.jpg
tags: mains, meat
ingredients:
- NY Strip Steak(s)
- salt to taste
directions:
- Bag the steak(s) and drop into 140° sous vide bath for 2 hours (or consult this handy [ChefSteps chart](https://s3.amazonaws.com/chefsteps/static/ChefSteps-SousVideReference.pdf))
- Pull from the bag, pat dry
- Sear in a scorching hot pan (butter + herb optional)
- Slice on a bias and sprinkle with sea salt
---
Cooking a steak in a water bath is the ultimate, both in terms of flavor and laziness. Dial in a precise temperature, then go take a nap. | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Nilla Wafer French Toast"
image: nilla-wafer.jpg
tags: breakfast, baking
ingredients:
- 4 eggs
- 1/4 cup heavy cream
- 2 tsp vanilla
- sprinkle of sugar
- 4 cups Nilla Wafers Minis
directions:
- Beat the eggs, heavy cream, vanilla, and sugar.
- Arrange the nillas in a few flat layers in a baking dish.
- Pour egg mixture over nillas. Let soak while oven preheats to 350°. Top with shake of cinnamon sugar.
- Bake until egg has set (it'll fluff up a bit)
---
From a weird Sunday morning when I realized we didn't have bread. Solid hitter. Served with [Treehive](https://amzn.to/2QBpGCH) Syrup, my new favorite breakfast obsession (it's mixed with honey, vanilla, and cinnamon, oof). | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Mississippi Pot Roast"
image: mississippi-pot-roast.jpg
imagecredit: https://www.today.com/today/amp/tdna199419
tags: mains, crock pot
ingredients:
- 3-4 lbs chuck roast
- 1 packet ranch mix
- 1 packet au jus gravy mix
- 1 stick butter
- 1 jar pepperoncinis (or 2)
directions:
- In your slow cooker, add the roast and top with both packet mixes, a stick of butter (sliced into a few chunks), and a jar (or 2) of pepperoncini peppers (the more the better, drained)
- Cook for 6-8 hours on low
- Serve with salt & vinegar potatoes
---
This is the recipe that rocked reddit, coming our way via [Today](https://www.today.com/today/amp/tdna199419) (believe it or not). It takes just minutes with almost no prep (use a slow cooker liner for no cleanup), and the leftovers can be used for sandwiches or nachos or eggs. If you like a thicker gravy, combine the dripping with flour/starch, or just enjoy the thinner jus.
| {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Mongolian Beef"
image: mongolian-beef.jpg
imagecredit: https://flic.kr/p/8ANQTc
tags: mains, meat
ingredients:
- vegetable oil
- 1⁄2 teaspoon ginger
- 1 tablespoon garlic
- 1⁄2 cup soy sauce
- 1⁄2 cup water
- 3⁄4 cup dark brown sugar
- 1 lb flank steak
- 1 yellow onion
- 2 large green onions
directions:
- Slice the beef thin and cook with a bit of oil (your choice) and the yellow onion (cut into petals) in a medium saucepan. Set aside when done.
- Make the sauce by heating 2 tsp of vegetable oil over med/low heat in the same pan. Don't get the oil too hot.
- Add ginger and garlic to the pan and quickly add the soy sauce and water before the garlic scorches.
- Dissolve the brown sugar in the sauce, then raise the heat to medium and boil the sauce for 2-3 minutes or until the sauce thickens.
- Remove from the heat, add beef back in. Toss
- Serve with rice, top with green onions
---
A quick go-to dinner. Can be made with almost any meat. I often used ground. Works perfect for lettuce wraps. Try replacing the onion with thinly sliced fennel.
Optional: spice this thing up, with a dose of your favorite chili paste/sauce. | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Green Spaghetti"
image: green-spaghetti.jpg
tags: mains, pasta, veg
ingredients:
- dried spaghetti
- giant bunch of dark greens (see notes)
- 4 cloves of garlic
- 1/4 cup parmesan cheese
- 1.4 cup ricotta or queso fresco
directions:
- Bring water to a boil and add spaghetti, greens, and whole garlic cloves
- Wilt the greens for a few minutes
- Use tongs to move greens and garlic to a blender, add fresh-grated parmesan, pulse for a few mins, add salt and pepper to taste
- Drain pasta, reserving a cup or so of the water
- Toss pasta in sauce, adding a splash of water to make everything happy
- Plate and top with freshly crumbled cheese and more cracked black pepper
---
We saw this on Jamie Oliver's TV show and made it that night. He calls for **cavolo nero** as the greens, but dinosaur kale or spinach or any dark leafy green will do. The bigger the green, the easier it is to fish out of the boiling water, so keep that in mind.
Start to finish this whole recipe takes about 10 minutes, but it's pretty rapid fire once you get stated. Have plates and an appetite standing by. | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Roasted Okra"
image: roasted-okra.jpg
tags: sides, vegetables
ingredients:
- 1 bunch of okra
- salt, pepper, etc to taste
directions:
- Wash the okra dang good
- Slice in half lengthwise
- Toss okra and seasoning on baking sheet (salt + pepper is great, I also really like Simply Asia spicy hibachi seasoing I found at HEB for like $2)
- Roast under the broiler for 10-15 mins. Keep an eye on it and pull it when the tips start to blacken.
---
I love me some okra, but prep is usually enough to avoid making it. This simple dish requires only a single cut per pod and a dash of seasoning- that's it. | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Jalapeno Cornbread"
image: jalapeno-cornbread.jpg
tags: sides, bread, spicy
ingredients:
- 1 box "fiesta" corn bread mix
- 1 can of sweet corn
- 1 cup sour cream
- pickled jalapeños to taste
directions:
- Make the cornbread mix according to the box (usually needs eggs and milk).
- Add a full can or corn (a regular sized can) and the sour cream (1 cup).
- Pour into a large glass baking dish and top with jalapeños.
- Bake a few mins longer than the box says (we've added a lot of liquid).
---
This corny cornbread pairs perfectly with chili or a bowl of stew. Add corn to the batter and you'll never go back. | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Cauliflower Cacciatore"
image: cauliflower-cacciatore.jpg
tags: mains, veg
ingredients:
- 1 head of cauliflower
- 1lb mini sweet peppers
- 1 yellow onion, diced
- 5oz mild goat cheese (we like Chavrie brand)
- 5oz sour cream
- jar of cacciatore sauce (we like Cookwell & Company)
- 1 cup red wine
- croutons (we make our own)
- fresh cilantro
directions:
- Start by pickling half your peppers. Chop all your peppers, put half in a jar, cover with vinegar (and whatever you like, spices, garlic, hot sauce). We're only looking for a quick pickle here, so do this, shake it up, and get back to the rest of the recipe.
- Next, start roasting the cauliflower, around 350°, to your desired level of doneness. Keep it firm and you can call it a "cauliflower steak", cook it down hard and it'll eat more like a mash. If you're making your own croutons, add some bread cubes tossed in oil/salt/pepper around the roasting pan.
- While the cauliflower roasts, stir the goat cheese and sour cream together (and whatever you like, spices, garlic, hot sauce). If it's too thick, thin it out with a bit of olive oil.
- Cook the onion and remaining peppers (non-pickled!) in a high heat pan with some olive oil. When softened, add your jar of cacciatore sauce and a cup of red wine. Stir and bring to a simmer, let it go until it gets a bit thicker.
- To assemble, plate a large dollop of our cream cheese spread, place half a cauliflower head on top, cover with a scoop of cacciatore sauce, top with croutons, cilantro, and our pickled peppers.
---
We first discovered this dish at [Arlo Grey](https://www.thelinehotel.com/austin/food-drink/) in Downtown Austin, and since, it's taken on a life of its own. We've cooked it a number of times and it's slowly evolved (mainly to become easier to cook, if you can believe it). It's one of our favorite vegetarian dishes and can easily swing vegan (just replace the dairy with something like hummus).
It's vegetables that eat like a full-on meat lasagna. Dang.
| {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Banana Bread"
image: banana-bread.jpg
imagecredit: https://flic.kr/p/7HZmzn
tags: breakfast, baking
ingredients:
- 4 bananas
- 1/2 cup butter
- 1/2 cup sugar
- 2 eggs
- 2 cups flour
- 1/2 tsp baking soda
- 1 tsp baking powder
- pinch salt
- 1/4 cup nuts (we like pecans)
directions:
- Beat the eggs, then cream with the butter and sugar
- Mix in bananas, then flour, baking soda/powder, salt, and nuts
- Add to greased and floured pan
- Bake until brown/cracked, toothpick comes out clean
---
From Angie's mom | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
---
layout: recipe
title: "Smashed Carrots"
image: smashed-carrots.jpg
tags: sides, vegetables
ingredients:
- 1 can carrots
- 1 tbsp butter
- 2 tbsp parmesan cheese
- salt & pepper to taste
directions:
- Combine carrots and butter, heat through (yes, you can microwave)
- Mash carrots, adding parmesan when smooshy
- Salt and pepper how you like
---
Generally, canned carrots are stinky and not worth eating. Butter and cheese changes that. | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
{% if page.nutrition %}
<!-- nutritional information -->
<h4 class="blue mt0 mb2 xs-center">Nutritional Information
{% if page.nutrition['servingSize'] != nil %}
({{ page.nutrition['servingSize'] }})
{% endif %}</h4>
<div class="flex flex-wrap" itemprop="nutrition" itemscope itemtype="http://schema.org/NutritionInformation">
{% assign nutrients = page.nutrition %}
{% for nutrient in nutrients %}
{% if nutrient.first == 'servingSize' %}{% continue %}{% endif %}
{% assign itemprop = nutrient.first %}
{% assign name = site.data.nutrients[itemprop].name %}
{% assign value = nutrient.last %}
{% assign unit = site.data.nutrients[itemprop].unit %}
<div class="rounded center border border-1 border-gray sm-col sm-col-2 lg-col-1 mr1 mb1">
<h5 class="bg-gray white m0 p1 capitalize">{{ name }}</h5>
<p itemprop="{{ itemprop }}">{{ value }}{{ unit }}</p>
</div>
{% endfor %}
</div>
<!-- end nutritional information -->
{% endif %}
| {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
<footer class="footer bg-darken-1 clearfix py4 mt3">
<div class="container px3 sm-px4">
<div class="clearfix">
<div class="sm-col sm-col-6">
<p class="left-align mb2"><a href="{{ "/search" | prepend: site.baseurl}}">{{ site.translation[site.language].search }}</a> | <a href="{{ "/blog" | prepend: site.baseurl}}">{{ site.translation[site.language].blog }}</a> | {{ site.translation[site.language].subscribe }} <a href="{{ "/feed.xml" | prepend: site.baseurl }}">via RSS</a></p>
</div>
<div class="sm-col sm-col-6">
<p class="right-align mb2">Made with <svg class="js-geomicon geomicon" height="0.8em" data-icon="heart" viewBox="0 0 32 32" style="fill:#007FFF"><title>heart icon</title><path d="M0 10 C0 6, 3 2, 8 2 C12 2, 15 5, 16 6 C17 5, 20 2, 24 2 C30 2, 32 6, 32 10 C32 18, 18 29, 16 30 C14 29, 0 18, 0 10"></path></svg> by <a href="http://twitter.com/clarklab">@clarklab</a></p>
</div>
</div>
</div>
</footer>
| {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
<link href="{{ "/css/bass.css" | prepend: site.baseurl }}" rel="stylesheet">
<link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}">
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl }}">
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.baseurl }}" />
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/hammer.js/2.0.4/hammer.min.js"></script>
<link rel="apple-touch-icon" sizes="180x180" href="{{ site.baseurl }}/icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="{{ site.baseurl }}/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="{{ site.baseurl }}/icons/favicon-16x16.png">
<link rel="manifest" href="{{ site.baseurl }}/manifest.json">
<link rel="mask-icon" href="{{ site.baseurl }}/icons/safari-pinned-tab.svg" color="#007fff">
<link rel="shortcut icon" href="{{ site.baseurl }}/icons/favicon.ico">
<meta name="msapplication-TileColor" content="#007fff">
<meta name="msapplication-config" content="{{ site.baseurl }}/icons/browserconfig.xml">
<meta name="theme-color" content="#007fff">
<script>
if ("serviceWorker" in navigator) {
if (navigator.serviceWorker.controller) {
console.log("An active service worker found, no need to register");
} else {
// Register the service worker
navigator.serviceWorker
.register("{{ site.baseurl }}/serviceworker.js", {
scope: "./"
})
.then(function (reg) {
console.log("Service worker has been registered for scope: " + reg.scope);
});
}
}
</script>
<!-- Twitter Cards -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@chowdownapp">
<meta name="twitter:creator" content="@clarklab">
{% if page.title %}<meta name="twitter:title" content="{{ page.title }}">{% else %}<meta name="twitter:title" content="Chowdown">{% endif %}
{% if page.url %}<meta name="twitter:url" content="{{ site.baseurl }}{{ page.url }}">{% endif %}
{% if page.directions %}<meta name="twitter:description" content="{{ page.content | strip_html }}">{% else %}<meta name="twitter:description" content="Chowdown">{% endif %}
{% if page.image %}<meta name="twitter:image:src" content="{{site.baseurl}}/images/{{ page.image }}">{% else %}<meta name="twitter:image:src" content="{{site.baseurl}}/images/crockpot-buffalo-chicken.jpg">{% endif %}
</head> | {
"repo_name": "clarklab/chowdown",
"stars": "585",
"repo_language": "HTML",
"file_name": "nutrients.yml",
"mime_type": "text/plain"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.