// ============================================================================================ /* * vgabios.c */ // ============================================================================================ // // Copyright (C) 2001-2008 the LGPL VGABios developers Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // ============================================================================================ // // This VGA Bios is specific to the plex86/bochs Emulated VGA card. // You can NOT drive any physical vga card with it. // // ============================================================================================ // // This file contains code ripped from : // - rombios.c of plex86 // // This VGA Bios contains fonts from : // - fntcol16.zip (c) by Joseph Gil avalable at : // ftp://ftp.simtel.net/pub/simtelnet/msdos/screen/fntcol16.zip // These fonts are public domain // // This VGA Bios is based on information taken from : // - Kevin Lawton's vga card emulation for bochs/plex86 // - Ralf Brown's interrupts list available at http://www.cs.cmu.edu/afs/cs/user/ralf/pub/WWW/files.html // - Finn Thogersons' VGADOC4b available at http://home.worldonline.dk/~finth/ // - Michael Abrash's Graphics Programming Black Book // - Francois Gervais' book "programmation des cartes graphiques cga-ega-vga" edited by sybex // - DOSEMU 1.0.1 source code for several tables values and formulas // // Thanks for patches, comments and ideas to : // - techt@pikeonline.net // // ============================================================================================ #include "vgabios.h" #ifdef VBE #include "vbe.h" #endif #define USE_BX_INFO /* Declares */ static Bit8u read_byte(); static Bit16u read_word(); static void write_byte(); static void write_word(); static Bit8u inb(); static Bit16u inw(); static void outb(); static void outw(); static Bit16u get_SS(); // Output static void printf(); static void unimplemented(); static void unknown(); static Bit8u find_vga_entry(); static void memsetb(); static void memsetw(); static void memcpyb(); static void memcpyw(); static void biosfn_set_video_mode(); static void biosfn_set_cursor_shape(); static void biosfn_set_cursor_pos(); static void biosfn_get_cursor_pos(); static void biosfn_set_active_page(); static void biosfn_scroll(); static void biosfn_read_char_attr(); static void biosfn_write_char_attr(); static void biosfn_write_char_only(); static void biosfn_write_pixel(); static void biosfn_read_pixel(); static void biosfn_write_teletype(); static void biosfn_perform_gray_scale_summing(); static void biosfn_load_text_user_pat(); static void biosfn_load_text_8_14_pat(); static void biosfn_load_text_8_8_pat(); static void biosfn_load_text_8_16_pat(); static void biosfn_load_gfx_8_8_chars(); static void biosfn_load_gfx_user_chars(); static void biosfn_load_gfx_8_14_chars(); static void biosfn_load_gfx_8_8_dd_chars(); static void biosfn_load_gfx_8_16_chars(); static void biosfn_get_font_info(); static void biosfn_alternate_prtsc(); static void biosfn_switch_video_interface(); static void biosfn_enable_video_refresh_control(); static void biosfn_write_string(); static void biosfn_read_state_info(); static void biosfn_read_video_state_size(); static Bit16u biosfn_save_video_state(); static Bit16u biosfn_restore_video_state(); extern Bit8u video_save_pointer_table[]; // This is for compiling with gcc2 and gcc3 #define ASM_START #asm #define ASM_END #endasm ASM_START MACRO SET_INT_VECTOR push ds xor ax, ax mov ds, ax mov ax, ?3 mov ?1*4, ax mov ax, ?2 mov ?1*4+2, ax pop ds MEND ASM_END ASM_START .text .rom .org 0 use16 386 vgabios_start: .byte 0x55, 0xaa /* BIOS signature, required for BIOS extensions */ .byte 0x40 /* BIOS extension length in units of 512 bytes */ vgabios_entry_point: jmp vgabios_init_func #ifdef PCIBIOS .org 0x18 .word vgabios_pci_data #endif // Info from Bart Oldeman .org 0x1e .ascii "IBM" .byte 0x00 vgabios_name: .ascii "Plex86/Bochs VGABios" #ifdef PCIBIOS .ascii " (PCI)" #endif .ascii " " .byte 0x00 vgabios_version: #ifndef VGABIOS_VERS .ascii "current-cvs" #else .ascii VGABIOS_VERS #endif .ascii " " vgabios_date: .ascii VGABIOS_DATE .byte 0x0a,0x0d .byte 0x00 vgabios_copyright: .ascii "(C) 2008 the LGPL VGABios developers Team" .byte 0x0a,0x0d .byte 0x00 vgabios_license: .ascii "This VGA/VBE Bios is released under the GNU LGPL" .byte 0x0a,0x0d .byte 0x0a,0x0d .byte 0x00 vgabios_website: .ascii "Please visit :" .byte 0x0a,0x0d ;;.ascii " . http://www.plex86.org" ;;.byte 0x0a,0x0d .ascii " . http://bochs.sourceforge.net" .byte 0x0a,0x0d .ascii " . http://www.nongnu.org/vgabios" .byte 0x0a,0x0d .byte 0x0a,0x0d .byte 0x00 #ifdef PCIBIOS vgabios_pci_data: .ascii "PCIR" #ifdef CIRRUS .word 0x1013 .word 0x00b8 // CLGD5446 #else #ifdef PCI_VID .word PCI_VID .word PCI_DID #else #error "Unknown PCI vendor and device id" #endif #endif .word 0 // reserved .word 0x18 // dlen .byte 0 // revision .byte 0x0 // class,hi: vga display .word 0x300 // class,lo: vga display .word 0x40 // bios size .word 1 // revision .byte 0 // intel x86 data .byte 0x80 // last image .word 0 // reserved #endif ;; ============================================================================================ ;; ;; Init Entry point ;; ;; ============================================================================================ vgabios_init_func: ;; init vga card call init_vga_card ;; init basic bios vars call init_bios_area #ifdef VBE ;; init vbe functions call vbe_init #endif ;; set int10 vect SET_INT_VECTOR(0x10, #0xC000, #vgabios_int10_handler) #ifdef CIRRUS call cirrus_init #endif ;; display splash screen call _display_splash_screen ;; init video mode and clear the screen mov ax,#0x0003 int #0x10 ;; show info call _display_info #ifdef VBE ;; show vbe info call vbe_display_info #endif #ifdef CIRRUS ;; show cirrus info call cirrus_display_info #endif retf ASM_END /* * int10 handled here */ ASM_START vgabios_int10_handler: pushf #ifdef DEBUG push es push ds pusha mov bx, #0xc000 mov ds, bx call _int10_debugmsg popa pop ds pop es #endif cmp ah, #0x0f jne int10_test_1A call biosfn_get_video_mode jmp int10_end int10_test_1A: cmp ah, #0x1a jne int10_test_0B call biosfn_group_1A jmp int10_end int10_test_0B: cmp ah, #0x0b jne int10_test_1103 call biosfn_group_0B jmp int10_end int10_test_1103: cmp ax, #0x1103 jne int10_test_12 call biosfn_set_text_block_specifier jmp int10_end int10_test_12: cmp ah, #0x12 jne int10_test_101B cmp bl, #0x10 jne int10_test_BL30 call biosfn_get_ega_info jmp int10_end int10_test_BL30: cmp bl, #0x30 jne int10_test_BL31 call biosfn_select_vert_res jmp int10_end int10_test_BL31: cmp bl, #0x31 jne int10_test_BL32 call biosfn_enable_default_palette_loading jmp int10_end int10_test_BL32: cmp bl, #0x32 jne int10_test_BL33 call biosfn_enable_video_addressing jmp int10_end int10_test_BL33: cmp bl, #0x33 jne int10_test_BL34 call biosfn_enable_grayscale_summing jmp int10_end int10_test_BL34: cmp bl, #0x34 jne int10_normal call biosfn_enable_cursor_emulation jmp int10_end int10_test_101B: cmp ax, #0x101b je int10_normal cmp ah, #0x10 #ifndef V
# Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# == Class: tripleo::profile::base::nova::api
#
# Nova API profile for tripleo
#
# [*bootstrap_node*]
# (Optional) The hostname of the node responsible for bootstrapping tasks
# Defaults to hiera('bootstrap_nodeid')
#
# [*certificates_specs*]
# (Optional) The specifications to give to certmonger for the certificate(s)
# it will create.
# Example with hiera:
# apache_certificates_specs:
# httpd-internal_api:
# hostname: <overcloud controller fqdn>
# service_certificate: <service certificate path>
# service_key: <service key path>
# principal: "haproxy/<overcloud controller fqdn>"
# Defaults to hiera('apache_certificate_specs', {}).
#
# [*enable_internal_tls*]
# (Optional) Whether TLS in the internal network is enabled or not.
# Defaults to hiera('enable_internal_tls', false)
#
# [*generate_service_certificates*]
# (Optional) Whether or not certmonger will generate certificates for
# HAProxy. This could be as many as specified by the $certificates_specs
# variable.
# Note that this doesn't configure the certificates in haproxy, it merely
# creates the certificates.
# Defaults to hiera('generate_service_certificate', false).
#
# [*nova_api_network*]
# (Optional) The network name where the nova API endpoint is listening on.
# This is set by t-h-t.
# Defaults to hiera('nova_api_network', undef)
#
# [*nova_api_wsgi_enabled*]
# (Optional) Whether or not deploy Nova API in WSGI with Apache.
# Nova Team discourages it.
# Defaults to hiera('nova_wsgi_enabled', false)
#
# [*step*]
# (Optional) The current step in deployment. See tripleo-heat-templates
# for more details.
# Defaults to hiera('step')
#
class tripleo::profile::base::nova::api (
$bootstrap_node = hiera('bootstrap_nodeid', undef),
$certificates_specs = hiera('apache_certificates_specs', {}),
$enable_internal_tls = hiera('enable_internal_tls', false),
$generate_service_certificates = hiera('generate_service_certificates', false),
$nova_api_network = hiera('nova_api_network', undef),
$nova_api_wsgi_enabled = hiera('nova_wsgi_enabled', false),
$step = hiera('step'),
) {
if $::hostname == downcase($bootstrap_node) {
$sync_db = true
} else {
$sync_db = false
}
include ::tripleo::profile::base::nova
include ::tripleo::profile::base::nova::authtoken
if $step >= 3 and $sync_db {
include ::nova::cell_v2::simple_setup
}
if $step >= 4 or ($step >= 3 and $sync_db) {
class { '::nova::api':
sync_db => $sync_db,
sync_db_api => $sync_db,
}
include ::nova::network::neutron
}
# Temporarily disable Nova API deployed in WSGI
# https://bugs.launchpad.net/nova/+bug/1661360
if $nova_api_wsgi_enabled {
if $enable_internal_tls {
if $generate_service_certificates {
ensure_resources('tripleo::certmonger::httpd', $certificates_specs)
}
if !$nova_api_network {
fail('nova_api_network is not set in the hieradata.')
}
$tls_certfile = $certificates_specs["httpd-${nova_api_network}"]['service_certificate']
$tls_keyfile = $certificates_specs["httpd-${nova_api_network}"]['service_key']
} else {
$tls_certfile = undef
$tls_keyfile = undef
}
if $step >= 4 or ($step >= 3 and $sync_db) {
class { '::nova::wsgi::apache_api':
ssl_cert => $tls_certfile,
ssl_key => $tls_keyfile,
}
}
}
if $step >= 5 {
if hiera('nova_enable_db_purge', true) {
include ::nova::cron::archive_deleted_rows
}
# At step 5, we consider all nova-compute services started and registred to nova-conductor
# So we want to update Nova Cells database to be aware of these hosts by executing the
# nova-cell_v2-discover_hosts command again.
# Doing it on a single nova-api node to avoid race condition.
if $sync_db {
Exec<| title == 'nova-cell_v2-discover_hosts' |> { refreshonly => false }
}
}
}